[][src]Trait tracing_unwrap::ResultExt

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
; }

Extension trait for Result types.

Required methods

fn unwrap_or_log(self) -> T where
    E: Debug

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.

fn expect_or_log(self, msg: &str) -> T where
    E: Debug

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.

fn unwrap_err_or_log(self) -> E where
    T: Debug

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.

fn expect_err_or_log(self, msg: &str) -> E where
    T: Debug

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.

Loading content...

Implementations on Foreign Types

impl<T, E> ResultExt<T, E> for Result<T, E>[src]

Loading content...

Implementors

Loading content...