pub trait Context<T> {
// Required methods
fn context(self, context: impl Display) -> Result<T>;
fn with_context<F, D>(self, f: F) -> Result<T>
where F: FnOnce() -> D,
D: Display;
}Expand description
anyhow-style context extension for Result and Option.
Required Methods§
Sourcefn with_context<F, D>(self, f: F) -> Result<T>
fn with_context<F, D>(self, f: F) -> Result<T>
Lazily wrap the error with additional context.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".