Trait mentat_core::util::OptionEffect
[−]
[src]
pub trait OptionEffect<T> { fn when_none<F: FnOnce()>(self, f: F) -> Self; fn when_some<F: FnOnce()>(self, f: F) -> Self; }
Side-effect chaining on Option
.
Required Methods
fn when_none<F: FnOnce()>(self, f: F) -> Self
Invoke f
if self
is None
, returning self
.
fn when_some<F: FnOnce()>(self, f: F) -> Self
Invoke f
if self
is Some
, returning self
.