Struct std::iter::TakeWhile

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

An iterator which only accepts elements while predicate is true

Trait Implementations

impl<'self, A, T: Iterator<A>> Iterator<A> for TakeWhile<'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.