Struct std::iter::Unfold[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

Methods

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

fn new<'a, A, St>(initial_state: St, f: |&mut St|: 'a -> 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<'a, A, St>(&mut self) -> Option<A>

fn size_hint<'a, A, St>(&self) -> (uint, Option<uint>)

fn size_hint<'a, A, St>(&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|: 'r -> B) -> Map<'r, A, B, Unfold<'a, A, St>>

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

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

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

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

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

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

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

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

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

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

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

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

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

fn advance<'a, A, St>(&mut self, |A| -> bool) -> bool

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

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

fn last<'a, A, St>(&mut self) -> Option<A>

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

fn count<'a, A, St>(&mut self) -> uint

fn all<'a, A, St>(&mut self, |A| -> bool) -> bool

fn any<'a, A, St>(&mut self, |A| -> bool) -> bool

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

fn position<'a, A, St>(&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>