Trait libbpf_rs::ErrorExt

source ·
pub trait ErrorExt: Sealed {
    type Output;

    // Required methods
    fn context<C>(self, context: C) -> Self::Output
       where C: IntoCowStr;
    fn with_context<C, F>(self, f: F) -> Self::Output
       where C: IntoCowStr,
             F: FnOnce() -> C;
}
Expand description

A trait providing ergonomic chaining capabilities to Error.

Required Associated Types§

source

type Output

The output type produced by context and with_context.

Required Methods§

source

fn context<C>(self, context: C) -> Self::Output
where C: IntoCowStr,

Add context to this error.

source

fn with_context<C, F>(self, f: F) -> Self::Output
where C: IntoCowStr, F: FnOnce() -> C,

Add context to this error, using a closure for lazy evaluation.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ErrorExt for Error

§

type Output = Error

source§

fn context<C>(self, context: C) -> Self::Output
where C: IntoCowStr,

source§

fn with_context<C, F>(self, f: F) -> Self::Output
where C: IntoCowStr, F: FnOnce() -> C,

Implementors§

source§

impl ErrorExt for libbpf_rs::Error

source§

impl<T, E> ErrorExt for Result<T, E>
where E: ErrorExt,

§

type Output = Result<T, <E as ErrorExt>::Output>