OptionExt

Trait OptionExt 

Source
pub trait OptionExt {
    type Val;

    // Required method
    fn then<F>(self, f: F)
       where F: FnOnce(Self::Val);
}
Expand description

Extension for std::option::Option.

Required Associated Types§

Source

type Val

Wrapped type by Option.

Required Methods§

Source

fn then<F>(self, f: F)
where F: FnOnce(Self::Val),

Consume the wrapped value with the given function if there is.

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 Val = T

Source§

fn then<F>(self, f: F)
where F: FnOnce(Self::Val),

Implementors§