Extensions for the Iterator trait.
trait IteratorExt : Iterator {
/* Provided methods */
fn collect(self) -> Vec<<Self as Iterator>::Item, Libc>
fn collect_into(&mut self, buf: &mut [<Self as Iterator>::Item]) -> usize
fn consume(&mut self, n: usize) -> &mut Self
fn enumerate(self) -> Enumerate<Self>
fn filter<F>(self, f: F) -> Filter<F, Self>
where F: FnMut(&<Self as Iterator>::Item) -> bool,
fn map<T, F>(self, f: F) -> Map<T, F, Self>
where F: FnMut(<Self as Iterator>::Item) -> T,
fn sum(self, start: <Self as Iterator>::Item) -> <Self as Iterator>::Item
where <Self as Iterator>::Item: Add<<Self as Iterator>::Item>,
<<Self as Iterator>::Item as Add<<Self as Iterator>::Item>>::Output = <Self as Iterator>::Item,
}| Receiver | Name | Description |
|---|---|---|
self | collect | Collects all elements of the iterator into a vector. |
&mut self | collect_into | Places the elements of the iterator into a slice until the slice or the iterator are exhausted. |
&mut self | consume | Removes a number of elements from the start of the iterator. |
self | enumerate | Returns a new iterator that returns the number of the element in addition to the element. |
self | filter | Returns a new iterator that filters elements via a function. |
self | map | Returns a new iterator that applies a function to all elements. |
self | sum | Sums all elements in the iterator. |