pub trait ICResultExt<T, E> {
// Required methods
fn capture<Kind>(self) -> Result<T, ICError<Kind>>
where E: Into<Kind>;
fn capture_box<Kind>(self) -> Result<T, ICError<Kind>>
where E: Error + Send + Sync + 'static,
Box<dyn Error + Send + Sync + 'static>: Into<Kind>;
}Expand description
Extension trait for converting Result<T, E> into Result<T, ICError<Kind>>,
capturing a new span trace.
Required Methods§
Sourcefn capture<Kind>(self) -> Result<T, ICError<Kind>>where
E: Into<Kind>,
fn capture<Kind>(self) -> Result<T, ICError<Kind>>where
E: Into<Kind>,
Convert the error via E: Into<Kind>, capturing a new span trace.
Sourcefn capture_box<Kind>(self) -> Result<T, ICError<Kind>>
fn capture_box<Kind>(self) -> Result<T, ICError<Kind>>
Box the error into Box<dyn Error>, then convert via Into<Kind>,
capturing a new span trace.
Use this when the error kind has #[from] Box<dyn Error + Send + Sync>.
When the kind instead has #[from] Box<ConcreteError>, use
.map_err(Box::new).capture().
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.