Struct std::iter::Scan

pub struct Scan<'self, A, B, T, St> {
    priv iter: T,
    priv f: &'self fn(&mut St, A) -> Option<B>,
    state: St,
}

An iterator to maintain state while iterating another iterator

Trait Implementations

impl<'self, A, B, T: Iterator<A>, St> Iterator<B> for Scan<'self, A, B, T, St>

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

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.