pub trait Context: Sized {
type Ok;
type Error: Error;
// Required method
fn with_context<C>(
self,
context: impl FnOnce() -> C,
) -> Result<Self::Ok, Self::Error>
where C: Display;
// Provided method
fn context<C>(self, context: C) -> Result<Self::Ok, Self::Error>
where C: Display { ... }
}Expand description
Adapter for providing context on Result
Required Associated Types§
Required Methods§
Provided Methods§
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.