Trait enso_prelude::OptionOps[][src]

pub trait OptionOps {
    type Item;
    fn map_none<F>(self, f: F) -> Self
    where
        F: FnOnce()
;
fn map_ref<U, F>(&self, f: F) -> Option<U>
    where
        F: FnOnce(&Self::Item) -> U
;
fn map_or_default<U, F>(self, f: F) -> U
    where
        U: Default,
        F: FnOnce(Self::Item) -> U
;
fn map_ref_or_default<U, F>(&self, f: F) -> U
    where
        U: Default,
        F: FnOnce(&Self::Item) -> U
;
fn for_each<U, F>(self, f: F)
    where
        F: FnOnce(Self::Item) -> U
;
fn for_each_ref<U, F>(&self, f: F)
    where
        F: FnOnce(&Self::Item) -> U
;
fn contains_if<F>(&self, f: F) -> bool
    where
        F: FnOnce(&Self::Item) -> bool
; }
Expand description

Adds mapping methods to the Option type.

Associated Types

Required methods

Returns true if option contains Some with value matching given predicate.

Implementations on Foreign Types

Implementors