Struct std::iter::Peekable[src]

pub struct Peekable<A, T> {
    // some fields omitted
}

An iterator with a peek() that returns an optional reference to the next element.

Methods

impl<'a, A, T: Iterator<A>> Peekable<A, T>

fn peek<'a, A, T: Iterator<A>>(&'a mut self) -> Option<&'a A>

Return a reference to the next element of the iterator with out advancing it, or None if the iterator is exhausted.

fn is_empty<'a, A, T: Iterator<A>>(&mut self) -> bool

Check whether peekable iterator is empty or not.

Trait Implementations

impl<A, T: Iterator<A>> Iterator<A> for Peekable<A, T>

fn next<A, T: Iterator<A>>(&mut self) -> Option<A>

fn size_hint<A, T: Iterator<A>>(&self) -> (uint, Option<uint>)

fn size_hint<A, T: Iterator<A>>(&self) -> (uint, Option<uint>)

fn chain<U: Iterator<A>>(self, U) -> Chain<Peekable<A, T>, U>

fn zip<B, U: Iterator<B>>(self, U) -> Zip<Peekable<A, T>, U>

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

fn filter<A, T: Iterator<A>>(self, |&A|: 'r -> bool) -> Filter<'r, A, Peekable<A, T>>

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

fn enumerate<A, T: Iterator<A>>(self) -> Enumerate<Peekable<A, T>>

fn peekable<A, T: Iterator<A>>(self) -> Peekable<A, Peekable<A, T>>

fn skip_while<A, T: Iterator<A>>(self, |&A|: 'r -> bool) -> SkipWhile<'r, A, Peekable<A, T>>

fn take_while<A, T: Iterator<A>>(self, |&A|: 'r -> bool) -> TakeWhile<'r, A, Peekable<A, T>>

fn skip<A, T: Iterator<A>>(self, uint) -> Skip<Peekable<A, T>>

fn take<A, T: Iterator<A>>(self, uint) -> Take<Peekable<A, T>>

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

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

fn fuse<A, T: Iterator<A>>(self) -> Fuse<Peekable<A, T>>

fn inspect<A, T: Iterator<A>>(self, |&A|: 'r) -> Inspect<'r, A, Peekable<A, T>>

fn by_ref<A, T: Iterator<A>>(&'r mut self) -> ByRef<'r, Peekable<A, T>>

fn advance<A, T: Iterator<A>>(&mut self, |A| -> bool) -> bool

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

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

fn last<A, T: Iterator<A>>(&mut self) -> Option<A>

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

fn count<A, T: Iterator<A>>(&mut self) -> uint

fn all<A, T: Iterator<A>>(&mut self, |A| -> bool) -> bool

fn any<A, T: Iterator<A>>(&mut self, |A| -> bool) -> bool

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

fn position<A, T: Iterator<A>>(&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>