pub trait EnrichableExt: Enrichable {
// Provided methods
fn enrich(self, msg: impl Into<Cow<'static, str>>) -> Self
where Self: Sized { ... }
fn enrich_with<F, R>(self, f: F) -> Self
where F: FnOnce() -> R,
R: Into<Cow<'static, str>>,
Self: Sized { ... }
}Expand description
Extension trait providing ergonomic error enrichment methods.
Provided Methods§
Sourcefn enrich(self, msg: impl Into<Cow<'static, str>>) -> Selfwhere
Self: Sized,
fn enrich(self, msg: impl Into<Cow<'static, str>>) -> Selfwhere
Self: Sized,
Adds enrichment information to the error.
It uses Location::caller to capture the file and line number
where this method is invoked.
Sourcefn enrich_with<F, R>(self, f: F) -> Self
fn enrich_with<F, R>(self, f: F) -> Self
Adds lazily evaluated enrichment information to the error.
It uses Location::caller to capture the file and line number
where this method is invoked.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".