Trait options_results::ResultIter [] [src]

pub trait ResultIter<T, E>: Iterator<Item = Result<T, E>> where
    Self: Sized
{ fn unwrap(self) -> Unwrap<Self, T, E> { ... } fn unwrap_or(self, def: T) -> UnwrapOr<Self, T, E> { ... } fn count_ok(self) -> usize { ... } fn count_err(self) -> usize { ... } fn count_ok_err(self) -> (usize, usize) { ... } fn find_ok(&mut self) -> Option<T> { ... } fn find_err(&mut self) -> Option<E> { ... } fn has_ok(&mut self) -> bool { ... } fn has_err(&mut self) -> bool { ... } fn ok_iter(self) -> OkIter<Self, T, E> { ... } fn err_iter(self) -> ErrIter<Self, T, E> { ... } }

Add some methods for the iterator of Result<T, E>.

Provided Methods

Create an iterator which yields the unwrapped value as the next value. (Unwrap<I>::next() will panic if the value is Err(_).)

Create an iterator which yields the unwrapped value or a default as the next value.

Count the number of Ok(_) in this iterator.

Count the number of Err(_) in this iterator.

Count the number of Ok(_) and Err(_) in this iterator. Return a tuple as (number of Ok value, number of Err value)

Searches for an element of an iterator that the value is Ok(_). If each element of the iterator all equal Err(_), it returns None.

Searches for an element of an iterator that the value is Err(_). If each element of the iterator all equal Ok(_), it returns None.

Tests if any element of the iterator are Ok(_).

Tests if any element of the iterator are Err(_).

Create an iterator which yields unwrapped Ok(_) value.

Create an iterator which yields unwrapped Err(_) value.

Implementors