Trait libimagerror::trace::MapErrTrace
source · pub trait MapErrTrace {
type Output;
fn map_err_trace(self) -> Self;
fn map_err_trace_exit_unwrap(self, code: i32) -> Self::Output;
}
Expand description
Helper functions for Result<T, E>
types to reduce overhead in the following situations:
ⓘ
function().map_err(|e| { trace_error(&e); e })
and variants
Required Associated Types
Required Methods
fn map_err_trace(self) -> Self
fn map_err_trace_exit_unwrap(self, code: i32) -> Self::Output
Implementations on Foreign Types
sourceimpl<U> MapErrTrace for Result<U, Error>
impl<U> MapErrTrace for Result<U, Error>
sourcefn map_err_trace(self) -> Self
fn map_err_trace(self) -> Self
Simply call trace_error()
on the Err (if there is one) and return the error.
This does nothing besides the side effect of printing the error trace
sourcefn map_err_trace_exit_unwrap(self, code: i32) -> Self::Output
fn map_err_trace_exit_unwrap(self, code: i32) -> Self::Output
Trace the error and exit or unwrap the Ok(_).