Trait foreach::ForEach
[−]
[src]
pub trait ForEach: Iterator { fn for_each<O: Into<Continue>, F: FnMut(Self::Item, &mut Self) -> O>(&mut self,
f: F); }
Trait to simplify usage of iterator inside iteration loop.
This trait is implemented for all iterators by default.
Required Methods
fn for_each<O: Into<Continue>, F: FnMut(Self::Item, &mut Self) -> O>(&mut self,
f: F)
f: F)
Iterates over all items and executes given closure.
This allows you to use iterator inside iteration loop, which is not posible when using for-in loop.
See crate-level docs for examples
Implementors
impl<T: Iterator> ForEach for T