pub trait Context<Ok, Kind> {
// Required method
fn context<Func, Str>(self, context: Func) -> Result<Ok, Error<Kind>>
where Self: Sized,
Func: FnOnce() -> Str,
Str: Into<String>;
}Expand description
Extension trait for Result and Option to add context to errors.
It is similar to anyhow’s Context trait, but it doesn’t have a
separation between .context() and .with_context() methods, and
it has only a single one that always takes a closure.