ErrorContext

Trait ErrorContext 

Source
pub trait ErrorContext<T> {
    // Required method
    fn with_context<F>(self, f: F) -> BwsResult<T>
       where F: FnOnce() -> String;
}
Expand description

Error context extension trait for adding context to errors

Required Methods§

Source

fn with_context<F>(self, f: F) -> BwsResult<T>
where F: FnOnce() -> String,

Add context to an error

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.

Implementations on Foreign Types§

Source§

impl<T, E> ErrorContext<T> for Result<T, E>
where E: Into<BwsError>,

Source§

fn with_context<F>(self, f: F) -> BwsResult<T>
where F: FnOnce() -> String,

Implementors§