pub trait ErrorExt: Sealed {
type Output;
// Required methods
fn context<C>(self, context: C) -> Self::Output
where C: IntoCowStr;
fn with_context<C, F>(self, f: F) -> Self::Output
where C: IntoCowStr,
F: FnOnce() -> C;
}
Expand description
A trait providing ergonomic chaining capabilities to Error
.
Required Associated Types§
sourcetype Output
type Output
The output type produced by context
and
with_context
.
Required Methods§
sourcefn with_context<C, F>(self, f: F) -> Self::Outputwhere
C: IntoCowStr,
F: FnOnce() -> C,
fn with_context<C, F>(self, f: F) -> Self::Outputwhere
C: IntoCowStr,
F: FnOnce() -> C,
Add context to this error, using a closure for lazy evaluation.
Object Safety§
This trait is not object safe.