Struct itertools::structs::PutBackN[][src]

pub struct PutBackN<I: Iterator> { /* fields omitted */ }

An iterator adaptor that allows putting multiple items in front of the iterator.

Iterator element type is I::Item.

Implementations

impl<I: Iterator> PutBackN<I>[src]

pub fn put_back(&mut self, x: I::Item)[src]

Puts x in front of the iterator. The values are yielded in order of the most recently put back values first.

use itertools::put_back_n;

let mut it = put_back_n(1..5);
it.next();
it.put_back(1);
it.put_back(0);

assert!(itertools::equal(it, 0..5));

Trait Implementations

impl<I: Clone + Iterator> Clone for PutBackN<I> where
    I::Item: Clone
[src]

impl<I: Debug + Iterator> Debug for PutBackN<I> where
    I::Item: Debug
[src]

impl<I: Iterator> Iterator for PutBackN<I>[src]

type Item = I::Item

The type of the elements being iterated over.

impl<I> PeekingNext for PutBackN<I> where
    I: Iterator
[src]

Auto Trait Implementations

impl<I> RefUnwindSafe for PutBackN<I> where
    I: RefUnwindSafe,
    <I as Iterator>::Item: RefUnwindSafe

impl<I> Send for PutBackN<I> where
    I: Send,
    <I as Iterator>::Item: Send

impl<I> Sync for PutBackN<I> where
    I: Sync,
    <I as Iterator>::Item: Sync

impl<I> Unpin for PutBackN<I> where
    I: Unpin,
    <I as Iterator>::Item: Unpin

impl<I> UnwindSafe for PutBackN<I> where
    I: UnwindSafe,
    <I as Iterator>::Item: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> Itertools for T where
    T: Iterator + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.