[][src]Trait cotton::prelude::TapOptionOps

pub trait TapOptionOps<T> {
    fn tap_some<R, F>(self, f: F) -> Self
    where
        F: FnOnce(&mut T) -> R
;
fn tap_none<R, F>(self, f: F) -> Self
    where
        F: FnOnce() -> R
; }

Tap operations for Option.

Required methods

fn tap_some<R, F>(self, f: F) -> Self where
    F: FnOnce(&mut T) -> R, 

Executes a closure if the value is Option::Some(T).

fn tap_none<R, F>(self, f: F) -> Self where
    F: FnOnce() -> R, 

Executes a closure if the value is Option::None.

Loading content...

Implementations on Foreign Types

impl<T> TapOptionOps<T> for Option<T>[src]

Loading content...

Implementors

Loading content...