OptionExt

Trait OptionExt 

Source
pub trait OptionExt: Sized + Sealed {
    type T;

    // Required methods
    fn is_none_or(self, f: impl FnOnce(Self::T) -> bool) -> bool;
    fn contains<U>(&self, u: &U) -> bool
       where Self::T: PartialEq<U>;
    fn unwrap_none(self)
       where Self::T: Debug;
    fn expect_none(self, msg: &str)
       where Self::T: Debug;
}

Required Associated Types§

Source

type T

Required Methods§

Source

fn is_none_or(self, f: impl FnOnce(Self::T) -> bool) -> bool

Source

fn contains<U>(&self, u: &U) -> bool
where Self::T: PartialEq<U>,

Source

fn unwrap_none(self)
where Self::T: Debug,

Source

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

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> OptionExt for Option<T>

Source§

type T = T

Source§

fn is_none_or(self, f: impl FnOnce(Self::T) -> bool) -> bool

Source§

fn contains<U>(&self, u: &U) -> bool
where Self::T: PartialEq<U>,

Source§

fn unwrap_none(self)
where Self::T: Debug,

Source§

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

Implementors§