pub trait ResultExt<T, E> {
    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

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 tracing::Subscriber at an ERROR 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 tracing::Subscriber at an ERROR 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 tracing::Subscriber at an ERROR 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 tracing::Subscriber at an ERROR level.

Implementations on Foreign Types

Implementors