Struct core::iter::Scan[src]

pub struct Scan<'a, A, B, T, St> {
    pub state: St,
    // some fields omitted
}

An iterator to maintain state while iterating another iterator

Fields

state

The current internal state to be passed to the closure next.

Trait Implementations

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

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

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

fn chain<U: Iterator<A>>(self, other: U) -> Chain<Self, U>

fn zip<B, U: Iterator<B>>(self, other: U) -> Zip<Self, U>

fn map<'r, B>(self, f: |A|: 'r -> B) -> Map<'r, A, B, Self>

fn filter<'r>(self, predicate: |&A|: 'r -> bool) -> Filter<'r, A, Self>

fn filter_map<'r, B>(self, f: |A|: 'r -> Option<B>) -> FilterMap<'r, A, B, Self>

fn enumerate(self) -> Enumerate<Self>

fn peekable(self) -> Peekable<A, Self>

fn skip_while<'r>(self, predicate: |&A|: 'r -> bool) -> SkipWhile<'r, A, Self>

fn take_while<'r>(self, predicate: |&A|: 'r -> bool) -> TakeWhile<'r, A, Self>

fn skip(self, n: uint) -> Skip<Self>

fn take(self, n: uint) -> Take<Self>

fn scan<'r, St, B>(self, initial_state: St, f: |&mut St, A|: 'r -> Option<B>) -> Scan<'r, A, B, Self, St>

fn flat_map<'r, B, U: Iterator<B>>(self, f: |A|: 'r -> U) -> FlatMap<'r, A, Self, U>

fn fuse(self) -> Fuse<Self>

fn inspect<'r>(self, f: |&A|: 'r) -> Inspect<'r, A, Self>

fn by_ref<'r>(&'r mut self) -> ByRef<'r, Self>

fn advance(&mut self, f: |A| -> bool) -> bool

fn collect<B: FromIterator<A>>(&mut self) -> B

fn nth(&mut self, n: uint) -> Option<A>

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

fn fold<B>(&mut self, init: B, f: |B, A| -> B) -> B

fn count(&mut self) -> uint

fn all(&mut self, f: |A| -> bool) -> bool

fn any(&mut self, f: |A| -> bool) -> bool

fn find(&mut self, predicate: |&A| -> bool) -> Option<A>

fn position(&mut self, predicate: |A| -> bool) -> Option<uint>

fn max_by<B: Ord>(&mut self, f: |&A| -> B) -> Option<A>

fn min_by<B: Ord>(&mut self, f: |&A| -> B) -> Option<A>