Trait tracing_unwrap::ResultExt
source · pub trait ResultExt<T, E> {
// Required methods
fn ok_or_log(self) -> Option<T>
where E: Debug;
fn unwrap_or_log(self) -> T
where E: Debug;
fn expect_or_log(self, msg: &str) -> T
where E: Debug;
fn unwrap_err_or_log(self) -> E
where T: Debug;
fn expect_err_or_log(self, msg: &str) -> E
where T: Debug;
}
Expand description
Extension trait for Result types.
Required Methods§
sourcefn ok_or_log(self) -> Option<T>where
E: Debug,
fn ok_or_log(self) -> Option<T>where
E: Debug,
Converts self
into an Option<T>
, consuming self
, and logs the
error, if any, to a tracing::Subscriber
at a WARN
level.