pub trait ResultExt<T, E> {
// Required methods
fn ctx<C: IntoErrorContext>(
self,
msg: C,
) -> Result<T, Box<ComposableError<E>>>;
fn ctx_with<F>(self, f: F) -> Result<T, Box<ComposableError<E>>>
where F: FnOnce() -> String;
}Expand description
Extension trait for ergonomic context addition to Result types.
Required Methods§
Sourcefn ctx<C: IntoErrorContext>(self, msg: C) -> Result<T, Box<ComposableError<E>>>
fn ctx<C: IntoErrorContext>(self, msg: C) -> Result<T, Box<ComposableError<E>>>
Adds a static context message to the error.
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.