Struct PutBack
#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct PutBack<I>
where
I: Iterator, { /* private fields */ }
An iterator adaptor that allows putting back a single item to the front of the iterator.
Iterator element type is I::Item.
Implementations
impl<I> PutBack<I>
where
I: Iterator,
fn with_value(self, value: I::Item) -> Selfput back value
value(builder method)fn into_parts(self) -> (Option<I::Item>, I)Split the
PutBackinto its parts.fn put_back(&mut self, x: I::Item) -> Option<I::Item>Put back a single value to the front of the iterator.
If a value is already in the put back slot, it is returned.
Trait Implementations
impl<I> Clone for PutBack<I>
where
I: Iterator + Clone,
I::Item: Clone,
fn clone(&self) -> Self
impl<I> Debug for PutBack<I>
where
I: Iterator + Debug,
I::Item: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<I> Iterator for PutBack<I>
where
I: Iterator,
type Item = <I as Iterator>::Item;fn next(&mut self) -> Option<Self::Item>fn size_hint(&self) -> (usize, Option<usize>)fn count(self) -> usizefn last(self) -> Option<Self::Item>fn nth(&mut self, n: usize) -> Option<Self::Item>fn all<G>(&mut self, f: G) -> bool where G: FnMut(Self::Item) -> bool,fn fold<Acc, G>(self, init: Acc, f: G) -> Acc where G: FnMut(Acc, Self::Item) -> Acc,
impl<I> PeekingNext for PutBack<I>
where
I: Iterator,
fn peeking_next<F>(&mut self, accept: F) -> Option<Self::Item> where F: FnOnce(&Self::Item) -> bool,