pub trait IteratorExt {
// Provided methods
fn try_scan<St, F, T, U, E>(self, init: St, f: F) -> TryScan<Self, St, F> ⓘ
where Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(&mut St, T) -> Result<Option<U>, E> { ... }
fn try_flat_map<F, T, U, V, E>(
self,
f: F,
) -> TryFlatMap<Self, F, U::IntoIter> ⓘ
where Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = V> { ... }
fn try_flatten<T, U, E>(self) -> TryFlatten<Self, T::IntoIter> ⓘ
where Self: Sized + Iterator<Item = Result<T, E>>,
T: IntoIterator<Item = U> { ... }
fn try_flat_map_results<F, T, U, V, E>(
self,
f: F,
) -> TryFlatMapResults<Self, F, U::IntoIter> ⓘ
where Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(T) -> Result<U, E>,
U: IntoIterator<Item = Result<V, E>> { ... }
fn try_flatten_results<T, U, E>(
self,
) -> TryFlattenResults<Self, T::IntoIter> ⓘ
where Self: Sized + Iterator<Item = Result<T, E>>,
T: IntoIterator<Item = Result<U, E>> { ... }
fn try_filter<F, T, E>(self, f: F) -> TryFilter<Self, F> ⓘ
where Self: Sized + Iterator<Item = Result<T, E>>,
F: FnMut(&T) -> Result<bool, E> { ... }
fn try_filter_map<F, T, U, E>(self, f: F) -> TryFilterMap<Self, F> ⓘ
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> { ... }
}
Expand description
An extension trait to Iterator
Provided Methods§
Sourcefn try_flat_map<F, T, U, V, E>(self, f: F) -> TryFlatMap<Self, F, U::IntoIter> ⓘ
fn try_flat_map<F, T, U, V, E>(self, f: F) -> TryFlatMap<Self, F, U::IntoIter> ⓘ
Creates a fallible iterator that works like map, but flattens nested structure.
Sourcefn try_flatten<T, U, E>(self) -> TryFlatten<Self, T::IntoIter> ⓘ
fn try_flatten<T, U, E>(self) -> TryFlatten<Self, T::IntoIter> ⓘ
Creates a fallible iterator that flattens nested structure.
Sourcefn try_flat_map_results<F, T, U, V, E>(
self,
f: F,
) -> TryFlatMapResults<Self, F, U::IntoIter> ⓘ
fn try_flat_map_results<F, T, U, V, E>( self, f: F, ) -> TryFlatMapResults<Self, F, U::IntoIter> ⓘ
Similar to try_flat_map, but flattens nested results.
Sourcefn try_flatten_results<T, U, E>(self) -> TryFlattenResults<Self, T::IntoIter> ⓘ
fn try_flatten_results<T, U, E>(self) -> TryFlattenResults<Self, T::IntoIter> ⓘ
Similar to try_flatten, but flattens nested results.
Sourcefn try_filter<F, T, E>(self, f: F) -> TryFilter<Self, F> ⓘ
fn try_filter<F, T, E>(self, f: F) -> TryFilter<Self, F> ⓘ
Creates a fallible iterator that filters items.
Sourcefn try_filter_map<F, T, U, E>(self, f: F) -> TryFilterMap<Self, F> ⓘ
fn try_filter_map<F, T, U, E>(self, f: F) -> TryFilterMap<Self, F> ⓘ
Creates a fallible iterator that both filters and maps.