Skip to main content

PeekableExt

Trait PeekableExt 

Source
pub trait PeekableExt: Iterator {
    // Required method
    fn peek(&mut self) -> Option<&Self::Item>;
}
Expand description

A trait for iterators that support peeking at the next item without consuming it.

Required Methods§

Source

fn peek(&mut self) -> Option<&Self::Item>

Peek at the next item without consuming it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

fn peek(&mut self) -> Option<&Self::Item>

Implementors§