ResultExt

Trait ResultExt 

Source
pub trait ResultExt<E> {
    type Ok;

    // Required methods
    fn log_err(self) -> Option<Self::Ok>;
    fn debug_assert_ok(self, reason: &str) -> Self;
    fn warn_on_err(self) -> Option<Self::Ok>;
    fn log_with_level(self, level: Level) -> Option<Self::Ok>;
    fn anyhow(self) -> Result<Self::Ok>
       where E: Into<Error>;
}

Required Associated Types§

Required Methods§

Source

fn log_err(self) -> Option<Self::Ok>

Source

fn debug_assert_ok(self, reason: &str) -> Self

Assert that this result should never be an error in development or tests.

Source

fn warn_on_err(self) -> Option<Self::Ok>

Source

fn log_with_level(self, level: Level) -> Option<Self::Ok>

Source

fn anyhow(self) -> Result<Self::Ok>
where E: Into<Error>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

type Ok = T

Source§

fn log_err(self) -> Option<T>

Source§

fn debug_assert_ok(self, reason: &str) -> Self

Source§

fn warn_on_err(self) -> Option<T>

Source§

fn log_with_level(self, level: Level) -> Option<T>

Source§

fn anyhow(self) -> Result<T>
where E: Into<Error>,

Implementors§