Trait stry_common::utils::IntoResult [−][src]
Wrap Self
in a Result
based off a predicate.
Provided methods
fn ok_if<E>(self, predicate: bool, err: E) -> Result<Self, E>
[src]
Results Ok(self)
if the predicate returns true
, or Err(err)
otherwise.
fn with_ok_if<F, E>(self, predicate: F, err: E) -> Result<Self, E> where
F: FnOnce(&Self) -> bool,
[src]
F: FnOnce(&Self) -> bool,
Results Ok(self)
if the predicate returns true
, or Err(err)
otherwise.
fn err_if<E>(self, predicate: bool, err: E) -> Result<Self, E>
[src]
Results Err(err)
if the predicate returns true
, or Ok(self)
otherwise.
fn with_err_if<F, E>(self, predicate: F, err: E) -> Result<Self, E> where
F: FnOnce(&Self) -> bool,
[src]
F: FnOnce(&Self) -> bool,
Results Err(err)
if the predicate returns true
, or Ok(self)
otherwise.