OptionExt

Trait OptionExt 

Source
pub trait OptionExt {
    type Item;

    // Required methods
    fn and_try<F, T>(self, f: F) -> TractResult<Option<T>>
       where F: Fn(Self::Item) -> TractResult<T>;
    fn and_ok<F, T>(self, f: F) -> TractResult<Option<T>>
       where F: Fn(Self::Item) -> T;
}

Required Associated Types§

Required Methods§

Source

fn and_try<F, T>(self, f: F) -> TractResult<Option<T>>
where F: Fn(Self::Item) -> TractResult<T>,

Source

fn and_ok<F, T>(self, f: F) -> TractResult<Option<T>>
where F: Fn(Self::Item) -> T,

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

Source§

type Item = A

Source§

fn and_try<F, T>(self, f: F) -> TractResult<Option<T>>
where F: Fn(Self::Item) -> TractResult<T>,

Source§

fn and_ok<F, T>(self, f: F) -> TractResult<Option<T>>
where F: Fn(Self::Item) -> T,

Implementors§