Trait ResultExt
Source pub trait ResultExt<T, E> {
// Required methods
fn unwrap_or_log(self, log: &Logger) -> T
where E: Debug;
fn expect_or_log(self, log: &Logger, msg: &str) -> T
where E: Debug;
fn unwrap_err_or_log(self, log: &Logger) -> E
where T: Debug;
fn expect_err_or_log(self, log: &Logger, msg: &str) -> E
where T: Debug;
}
Expand description
Extension trait for Result types.
Unwraps a result, yielding the content of an Ok.
§Panics
Panics if the value is an Err, logging a message provided by the
Err’s value to a slog::Logger at a Critical level.
Unwraps a result, yielding the content of an Ok.
§Panics
Panics if the value is an Err, logging the passed message and the
content of the Err to a slog::Logger at a Critical level.
Unwraps a result, yielding the content of an Err.
§Panics
Panics if the value is an Ok, logging a message provided by the
Ok’s value to a slog::Logger at a Critical level.
Unwraps a result, yielding the content of an Err.
§Panics
Panics if the value is an Ok, logging the passed message and the
content of the Ok to a slog::Logger at a Critical level.