pub trait ResultExt<T> {
// Required method
fn with_context<C: Display>(self, f: impl FnOnce() -> C) -> Result<T>;
}Expand description
Extension trait for adding context to a Result.
Required Methods§
Sourcefn with_context<C: Display>(self, f: impl FnOnce() -> C) -> Result<T>
fn with_context<C: Display>(self, f: impl FnOnce() -> C) -> Result<T>
Attach context lazily to the error branch of a result.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".