Trait IteratorPeekingNext
pub trait IteratorPeekingNext: Iterator {
// Required method
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> ⓘ
where Self: Sized,
F: FnOnce(&Self::Item) -> bool;
}
Available on crate feature
dep_itertools
only.Expand description
🔄
itertools
An iterator that allows peeking at an element before deciding to accept it.
Re-exported from the itertools
crate
PeekingNext
→IteratorPeekingNext
.
An iterator that allows peeking at an element before deciding to accept it.
See .peeking_take_while()
for more information.
This is implemented by peeking adaptors like peekable and put back,
but also by a few iterators that can be peeked natively, like the slice’s
by reference iterator (std::slice::Iter
).