devela::_dep::itertools

Function peek_nth

pub fn peek_nth<I>(iterable: I) -> PeekNth<<I as IntoIterator>::IntoIter> 
where I: IntoIterator,
Available on crate feature dep_itertools only.
Expand description

A drop-in replacement for std::iter::Peekable which adds a peek_nth method allowing the user to peek at a value several iterations forward without advancing the base iterator.

This differs from multipeek in that subsequent calls to peek or peek_nth will always return the same value until next is called (making reset_peek unnecessary).