Struct std::iter::Filter

pub struct Filter<'self, A, T> {
    priv iter: T,
    priv predicate: &'self fn(&A) -> bool,
}

An iterator which filters the elements of iter with predicate

Trait Implementations

impl<'self, A, T: Iterator<A>> Iterator<A> for Filter<'self, A, T>

fn next(&mut self) -> Option<A>

Advance the iterator and return the next value. Return None when the end is reached.

fn size_hint(&self) -> (uint, Option<uint>)

Return a lower bound and upper bound on the remaining length of the iterator.

The common use case for the estimate is pre-allocating space to store the results.

impl<'self, A, T: DoubleEndedIterator<A>> DoubleEndedIterator<A> for Filter<'self, A, T>

fn next_back(&mut self) -> Option<A>

Yield an element from the end of the range, returning None if the range is empty.