Trait imply_option::ImplyOption[][src]

pub trait ImplyOption<T: Sized>: Sized + PartialEq<bool> {
    fn then(self, value: T) -> Option<T> { ... }
fn then_do(
        self,
        value: impl FnOnce() -> T
    ) -> Option<T> { ... } }

Allows construction of an Option<T> based on a bool.

Provided Methods

If self == true returns Some(value).

If self == true returns Some(value) where value is lazily constructed.

Implementors