[][src]Trait naut::combinators::FallbackIf

pub trait FallbackIf<T, E> {
    pub fn fallback_if<P, F, V>(
        self,
        predicate: P,
        f: F,
        alternative: V
    ) -> Result<T, E>
    where
        P: Into<bool>,
        F: FnOnce(V) -> Result<T, E>
; }

Required methods

pub fn fallback_if<P, F, V>(
    self,
    predicate: P,
    f: F,
    alternative: V
) -> Result<T, E> where
    P: Into<bool>,
    F: FnOnce(V) -> Result<T, E>, 
[src]

Loading content...

Implementations on Foreign Types

impl<T, E> FallbackIf<T, E> for Result<T, E>[src]

pub fn fallback_if<P, F, V>(
    self,
    predicate: P,
    f: F,
    alternative: V
) -> Result<T, E> where
    P: Into<bool>,
    F: FnOnce(V) -> Result<T, E>, 
[src]

Fallback to an alternative when a result produces an error and the predicate evaluates to true, otherwise keep the current result

Loading content...

Implementors

Loading content...