Struct std::iter::Peekable
[−]
[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.
This struct
is created by the peekable()
method on Iterator
. See its
documentation for more.
Methods
impl<I> Peekable<I> where I: Iterator
fn peek(&mut self) -> Option<&I::Item>
Returns 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
Unstable (
core
#27701): the libcore library has not yet been scrutinized for stabilization in terms of structure and naming
Checks whether peekable iterator is empty or not.