pub struct Fallible<I, C> { /* private fields */ }Implementations§
Source§impl<I, C> Fallible<I, C>
impl<I, C> Fallible<I, C>
Sourcepub fn process<F, B>(self, f: F) -> Result<B, C::Collection>
pub fn process<F, B>(self, f: F) -> Result<B, C::Collection>
“Lift” a function of the values of an iterator so that it can process an iterator of Result
values instead.
f is a closure that takes RawIter, an iterator adapter that wraps the inner
iterator and implements Iterator<Item=I::OK>.
Returns either the returned value of closure f wrapped in the Ok variant, or the error
wrapped in Err variant, in a way specified by C’s implementation of ErrorCollector.
Sourcepub fn process_no_discard<F, B>(self, f: F) -> (B, Option<C::Collection>)
pub fn process_no_discard<F, B>(self, f: F) -> (B, Option<C::Collection>)
“Lift” a function of the values of an iterator so that it can process an iterator of Result
values instead.
f is a closure that takes RawIter, an iterator adapter that wraps the inner
iterator and implements Iterator<Item=I::OK>.
Returns both the returned value of closure f and None if the wrapped iterator runs to
completion; otherwise, returns the intermediate value produced so far and the errors in a
way specified by C’s implementation of ErrorCollector