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.