WrapErr

Trait WrapErr 

Source
pub trait WrapErr {
    // Required method
    fn wrap_err<C>(self, context: C) -> Self
       where C: Display + Send + Sync + 'static;
}
Expand description

Provides the wrap_err method for the error type.

Implement for your own error type if you want to use it as an error in macros.

Required Methods§

Source

fn wrap_err<C>(self, context: C) -> Self
where C: Display + Send + Sync + 'static,

Wrap the error value with additional context.

The function should work similarly to anyhow::Error::context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§