ResultExt

Trait ResultExt 

Source
pub trait ResultExt: Sized + Sealed {
    type T;
    type E;

    // Required methods
    fn is_err_or(self, f: impl FnOnce(Self::T) -> bool) -> bool;
    fn is_ok_or(self, f: impl FnOnce(Self::E) -> bool) -> bool;
    fn contains<U>(&self, u: &U) -> bool
       where Self::T: PartialEq<U>;
    fn contains_err<U>(&self, u: &U) -> bool
       where Self::E: PartialEq<U>;
}

Required Associated Types§

Source

type T

Source

type E

Required Methods§

Source

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

Source

fn is_ok_or(self, f: impl FnOnce(Self::E) -> bool) -> bool

Source

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

Source

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

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 for Result<T, E>

Source§

type T = T

Source§

type E = E

Source§

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

Source§

fn is_ok_or(self, f: impl FnOnce(Self::E) -> bool) -> bool

Source§

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

Source§

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

Implementors§