Trait mentat_core::util::ResultEffect
[−]
[src]
pub trait ResultEffect<T> { fn when_ok<F: FnOnce()>(self, f: F) -> Self; fn when_err<F: FnOnce()>(self, f: F) -> Self; }
Side-effect chaining on Result
.
Required Methods
fn when_ok<F: FnOnce()>(self, f: F) -> Self
Invoke f
if self
is Ok
, returning self
.
fn when_err<F: FnOnce()>(self, f: F) -> Self
Invoke f
if self
is Err
, returning self
.