IterResult

Trait IterResult 

Source
pub trait IterResult: Iterator<Item = Result<Self::Ok, Self::Error>> + Sized {
    type Ok;
    type Error;

    // Provided methods
    fn failfast(self) -> Fallible<Self, Option<Self::Error>> { ... }
    fn ignore(self) -> Fallible<Self, Ignore> { ... }
    fn accumulate(self) -> Fallible<Self, Vec<Self::Error>> { ... }
    fn fallible<C: ErrorCollector<Self::Error>>(self) -> Fallible<Self, C> { ... }
    fn with_collector<C: ErrorCollector<Self::Error>>(
        self,
        collector: C,
    ) -> Fallible<Self, C> { ... }
}
Expand description

An extension trait implemented for all iterators of Result types.

Required Associated Types§

Source

type Ok

The type wrapped by the Ok variant of the Result type

Source

type Error

The type wrapped by the Err variant of the Result type

Provided Methods§

Source

fn failfast(self) -> Fallible<Self, Option<Self::Error>>

Produces a version of Fallible that stops iterating upon encountering the 1st error.

Source

fn ignore(self) -> Fallible<Self, Ignore>

Produces a version of Fallible that keeps iterating and ignores all errors.

Source

fn accumulate(self) -> Fallible<Self, Vec<Self::Error>>

Produces a version of Fallible that keeps iterating and stores all errors in a Vec.

Source

fn fallible<C: ErrorCollector<Self::Error>>(self) -> Fallible<Self, C>

Produces a version of Fallible with a custom type of ErrorCollector

Source

fn with_collector<C: ErrorCollector<Self::Error>>( self, collector: C, ) -> Fallible<Self, C>

Produces a version of Fallible with an existing value of ErrorCollector

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I, T, E> IterResult for I
where I: Iterator<Item = Result<T, E>>,

Source§

type Ok = T

Source§

type Error = E