Trait lrs::iter::IteratorExt

Extensions for the Iterator trait.

Syntax

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,
}

Methods

ReceiverNameDescription
selfcollect

Collects all elements of the iterator into a vector.

&mut selfcollect_into

Places the elements of the iterator into a slice until the slice or the iterator are exhausted.

&mut selfconsume

Removes a number of elements from the start of the iterator.

selfenumerate

Returns a new iterator that returns the number of the element in addition to the element.

selffilter

Returns a new iterator that filters elements via a function.

selfmap

Returns a new iterator that applies a function to all elements.

selfsum

Sums all elements in the iterator.