Trait re_log::ResultExt

source ·
pub trait ResultExt<T, E> {
    // Required methods
    fn ok_or_log_error(self) -> Option<T>;
    fn ok_or_log_error_once(self) -> Option<T>;
    fn warn_on_err_once(self, msg: impl Display) -> Option<T>;
    fn unwrap_debug_or_log_error(self) -> Option<T>;
}

Required Methods§

source

fn ok_or_log_error(self) -> Option<T>

Logs an error if the result is an error and returns the result.

source

fn ok_or_log_error_once(self) -> Option<T>

Logs an error if the result is an error and returns the result, but only once.

source

fn warn_on_err_once(self, msg: impl Display) -> Option<T>

Log a warning if there is an Err, but only log the exact same message once.

source

fn unwrap_debug_or_log_error(self) -> Option<T>

Unwraps in debug builds otherwise logs an error if the result is an error and returns the result.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T, E> ResultExt<T, E> for Result<T, E>
where E: Display,

source§

fn warn_on_err_once(self, msg: impl Display) -> Option<T>

Log a warning if there is an Err, but only log the exact same message once.

source§

fn ok_or_log_error(self) -> Option<T>

source§

fn ok_or_log_error_once(self) -> Option<T>

source§

fn unwrap_debug_or_log_error(self) -> Option<T>

Implementors§