Skip to main content

OptionExt

Trait OptionExt 

Source
pub trait OptionExt<T> {
    // Required methods
    fn unwrap_or_log(self) -> T;
    fn expect_or_log(self, msg: &str) -> T;
    fn unwrap_none_or_log(self)
       where T: Debug;
    fn expect_none_or_log(self, msg: &str)
       where T: Debug;
}
Expand description

Extension trait for Option types.

Required Methods§

Source

fn unwrap_or_log(self) -> T

Source

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

Source

fn unwrap_none_or_log(self)
where T: Debug,

Source

fn expect_none_or_log(self, msg: &str)
where T: Debug,

Implementations on Foreign Types§

Source§

impl<T> OptionExt<T> for Option<T>

Source§

fn unwrap_or_log(self) -> T

Source§

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

Source§

fn unwrap_none_or_log(self)
where T: Debug,

Source§

fn expect_none_or_log(self, msg: &str)
where T: Debug,

Implementors§