Trait iterator_ext::IteratorExt [−][src]
pub trait IteratorExt { fn try_flat_map<F, T, U, V, E>(
self,
f: F
) -> TryFlatMap<Self, F, U::IntoIter>ⓘNotable traits for TryFlatMap<I, F, J>
impl<I, F, J, T, U, V, E> Iterator for TryFlatMap<I, F, J> where
I: Iterator<Item = Result<T, E>>,
J: Iterator<Item = Result<V, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>, IntoIter = J>, type Item = Result<V, E>;
where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>>; fn try_filter_map<F, T, U, E>(self, f: F) -> TryFilterMap<Self, F>ⓘNotable traits for TryFilterMap<I, F>
impl<I, T, U, E, F> Iterator for TryFilterMap<I, F> where
I: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>, type Item = Result<U, E>;
where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>; fn map_err<F, Ein, Eout>(self, f: F) -> MapErr<Self, F>ⓘ
where
Self: Sized,
F: FnMut(Ein) -> Eout; fn and_then<F, T, U, E>(self, f: F) -> AndThen<Self, F>ⓘ
where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>; }
An extension trait to Iterator
Required methods
fn try_flat_map<F, T, U, V, E>(self, f: F) -> TryFlatMap<Self, F, U::IntoIter>ⓘNotable traits for TryFlatMap<I, F, J>
impl<I, F, J, T, U, V, E> Iterator for TryFlatMap<I, F, J> where
I: Iterator<Item = Result<T, E>>,
J: Iterator<Item = Result<V, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>, IntoIter = J>, type Item = Result<V, E>;
where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>>,
[src]
Notable traits for TryFlatMap<I, F, J>
impl<I, F, J, T, U, V, E> Iterator for TryFlatMap<I, F, J> where
I: Iterator<Item = Result<T, E>>,
J: Iterator<Item = Result<V, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>, IntoIter = J>, type Item = Result<V, E>;
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>>,
Creates a fallible iterator that works like map, but flattens nested structure.
fn try_filter_map<F, T, U, E>(self, f: F) -> TryFilterMap<Self, F>ⓘNotable traits for TryFilterMap<I, F>
impl<I, T, U, E, F> Iterator for TryFilterMap<I, F> where
I: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>, type Item = Result<U, E>;
where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>,
[src]
Notable traits for TryFilterMap<I, F>
impl<I, T, U, E, F> Iterator for TryFilterMap<I, F> where
I: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>, type Item = Result<U, E>;
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>,
Creates a fallible iterator that both filters and maps.
fn map_err<F, Ein, Eout>(self, f: F) -> MapErr<Self, F>ⓘ where
Self: Sized,
F: FnMut(Ein) -> Eout,
[src]
Self: Sized,
F: FnMut(Ein) -> Eout,
Maps a Result<T, E>
to Result<T, F>
by applying a function to a contained Err value, leaving an Ok value untouched.
fn and_then<F, T, U, E>(self, f: F) -> AndThen<Self, F>ⓘ where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
[src]
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
Takes a closure and creates a fallible iterator which calls that closure on each element.
Implementors
impl<I> IteratorExt for I where
I: Iterator,
[src]
impl<I> IteratorExt for I where
I: Iterator,
[src]fn try_flat_map<F, T, U, V, E>(self, f: F) -> TryFlatMap<Self, F, U::IntoIter>ⓘNotable traits for TryFlatMap<I, F, J>
impl<I, F, J, T, U, V, E> Iterator for TryFlatMap<I, F, J> where
I: Iterator<Item = Result<T, E>>,
J: Iterator<Item = Result<V, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>, IntoIter = J>, type Item = Result<V, E>;
where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>>,
[src]
Notable traits for TryFlatMap<I, F, J>
impl<I, F, J, T, U, V, E> Iterator for TryFlatMap<I, F, J> where
I: Iterator<Item = Result<T, E>>,
J: Iterator<Item = Result<V, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>, IntoIter = J>, type Item = Result<V, E>;
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>>,
fn try_filter_map<F, T, U, E>(self, f: F) -> TryFilterMap<Self, F>ⓘNotable traits for TryFilterMap<I, F>
impl<I, T, U, E, F> Iterator for TryFilterMap<I, F> where
I: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>, type Item = Result<U, E>;
where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>,
[src]
Notable traits for TryFilterMap<I, F>
impl<I, T, U, E, F> Iterator for TryFilterMap<I, F> where
I: Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>, type Item = Result<U, E>;
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<Option<U>, E>,
fn map_err<F, Ein, Eout>(self, f: F) -> MapErr<Self, F>ⓘ where
Self: Sized,
F: FnMut(Ein) -> Eout,
[src]
Self: Sized,
F: FnMut(Ein) -> Eout,
fn and_then<F, T, U, E>(self, f: F) -> AndThen<Self, F>ⓘ where
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
[src]
Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,