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

#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct Peekable<I> where I: Iterator {
    // some fields omitted
}

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

Methods

impl<I> Peekable<I> where I: Iterator

fn peek(&mut self) -> Option<&<I as Iterator>::Item>

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

fn is_empty(&mut self) -> bool

Check whether peekable iterator is empty or not.

Trait Implementations

impl<I> Clone for Peekable<I> where I: Clone, I: Iterator, <I as Iterator>::Item: Clone

fn clone(&self) -> Peekable<I>

fn clone_from(&mut self, &Peekable<I>)

impl<I> Iterator for Peekable<I> where I: Iterator

type Item = <I as Iterator>::Item

fn next(&mut self) -> Option<<I as Iterator>::Item>

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

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

impl<I> ExactSizeIterator for Peekable<I> where I: ExactSizeIterator

fn len(&self) -> usize