pub trait ResultExt<T, E> {
// Required methods
fn log_error(self, msg: &str) -> Self;
fn with_context<F, C>(self, f: F) -> Result<T, ContextError<E, C>>
where F: FnOnce() -> C,
E: StdError + 'static,
C: Display + Debug + Send + Sync + 'static;
}
Expand description
Extension trait for Result to add logging and context
Required Methods§
Sourcefn with_context<F, C>(self, f: F) -> Result<T, ContextError<E, C>>
fn with_context<F, C>(self, f: F) -> Result<T, ContextError<E, C>>
Attach context to the 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.