Struct std::iter::UnfoldExperimental [-]  [+] [src]

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

An iterator which just modifies the contained state throughout iteration.

Fields

state

Internal state that will be yielded on the next iteration

Methods

impl<'a, A, St> Unfold<'a, A, St>

fn new(initial_state: St, f: |&mut St| -> Option<A>) -> Unfold<'a, A, St>

Creates a new iterator with the specified closure as the "iterator function" and an initial state to eventually pass to the iterator

Trait Implementations

impl<'a, A, St> Iterator<A> for Unfold<'a, A, St>

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

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

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

fn chain<U: Iterator<A>>(self, U) -> Chain<Unfold<'a, A, St>, U>

fn zip<B, U: Iterator<B>>(self, U) -> Zip<Unfold<'a, A, St>, U>

fn map<B>(self, |A| -> B) -> Map<'r, A, B, Unfold<'a, A, St>>

fn filter(self, |&A| -> bool) -> Filter<'r, A, Unfold<'a, A, St>>

fn filter_map<B>(self, |A| -> Option<B>) -> FilterMap<'r, A, B, Unfold<'a, A, St>>

fn enumerate(self) -> Enumerate<Unfold<'a, A, St>>

fn peekable(self) -> Peekable<A, Unfold<'a, A, St>>

fn skip_while(self, |&A| -> bool) -> SkipWhile<'r, A, Unfold<'a, A, St>>

fn take_while(self, |&A| -> bool) -> TakeWhile<'r, A, Unfold<'a, A, St>>

fn skip(self, uint) -> Skip<Unfold<'a, A, St>>

fn take(self, uint) -> Take<Unfold<'a, A, St>>

fn scan<St, B>(self, St, |&mut St, A| -> Option<B>) -> Scan<'r, A, B, Unfold<'a, A, St>, St>

fn flat_map<B, U: Iterator<B>>(self, |A| -> U) -> FlatMap<'r, A, Unfold<'a, A, St>, U>

fn fuse(self) -> Fuse<Unfold<'a, A, St>>

fn inspect(self, |&A|) -> Inspect<'r, A, Unfold<'a, A, St>>

fn by_ref(&'r mut self) -> ByRef<'r, Unfold<'a, A, St>>

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

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

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

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

fn count(&mut self) -> uint

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

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

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

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

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

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