pub trait BoxedResultExt<T, E> {
// Required methods
fn ctx_boxed<C: IntoErrorContext>(self, msg: C) -> Self;
fn ctx_boxed_with<F>(self, f: F) -> Self
where F: FnOnce() -> String;
}Expand description
Extension trait for adding context to already-boxed ComposableError results.
This trait allows chaining .ctx() calls on results that already contain
a boxed ComposableError.
§Examples
use error_rail::traits::{ResultExt, BoxedResultExt};
fn inner() -> Result<(), Box<error_rail::ComposableError<&'static str>>> {
Err("inner error").ctx("inner operation")
}
fn outer() -> Result<(), Box<error_rail::ComposableError<&'static str>>> {
inner().ctx_boxed("outer operation")
}Required Methods§
Sourcefn ctx_boxed<C: IntoErrorContext>(self, msg: C) -> Self
fn ctx_boxed<C: IntoErrorContext>(self, msg: C) -> Self
Adds additional context to an already-boxed ComposableError.
Sourcefn ctx_boxed_with<F>(self, f: F) -> Self
fn ctx_boxed_with<F>(self, f: F) -> Self
Adds lazily-evaluated context to an already-boxed ComposableError.
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.