[−][src]Trait itertools::PeekingNext
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
).
Required methods
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
F: FnOnce(&Self::Item) -> bool,
Pass a reference to the next iterator element to the closure accept
;
if accept
returns true, return it as the next element,
else None.
Implementations on Foreign Types
impl<I> PeekingNext for Peekable<I> where
I: Iterator,
[src]
I: Iterator,
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<'a, T> PeekingNext for Iter<'a, T>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<'a> PeekingNext for Chars<'a>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<'a> PeekingNext for CharIndices<'a>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<'a> PeekingNext for Bytes<'a>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<'a, T> PeekingNext for Iter<'a, T>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<'a, T> PeekingNext for Iter<'a, T>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<T> PeekingNext for Empty<T>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<'a, T> PeekingNext for Iter<'a, T>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<'a, T> PeekingNext for Iter<'a, T>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<I: Clone + PeekingNext + DoubleEndedIterator> PeekingNext for Rev<I>
[src]
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
Implementors
impl<I> PeekingNext for MultiPeek<I> where
I: Iterator,
[src]
I: Iterator,
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<I> PeekingNext for PutBack<I> where
I: Iterator,
[src]
I: Iterator,
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where
F: FnOnce(&Self::Item) -> bool,
[src]
F: FnOnce(&Self::Item) -> bool,
impl<I> PeekingNext for PutBackN<I> where
I: Iterator,
[src]
I: Iterator,