Struct itertools::structs::Tuples[][src]

#[must_use = "iterator adaptors are lazy and do nothing unless consumed"]
pub struct Tuples<I, T> where
    I: Iterator<Item = T::Item>,
    T: HomogeneousTuple
{ /* fields omitted */ }

An iterator that groups the items in tuples of a specific size.

See .tuples() for more information.

Implementations

impl<I, T> Tuples<I, T> where
    I: Iterator<Item = T::Item>,
    T: HomogeneousTuple
[src]

pub fn into_buffer(self) -> TupleBuffer<T>

Notable traits for TupleBuffer<T>

impl<T> Iterator for TupleBuffer<T> where
    T: HomogeneousTuple
type Item = T::Item;
[src]

Return a buffer with the produced items that was not enough to be grouped in a tuple.

use itertools::Itertools;

let mut iter = (0..5).tuples();
assert_eq!(Some((0, 1, 2)), iter.next());
assert_eq!(None, iter.next());
itertools::assert_equal(vec![3, 4], iter.into_buffer());

Trait Implementations

impl<I: Clone, T: Clone> Clone for Tuples<I, T> where
    I: Iterator<Item = T::Item>,
    T: HomogeneousTuple,
    T::Buffer: Clone
[src]

impl<I, T> Iterator for Tuples<I, T> where
    I: Iterator<Item = T::Item>,
    T: HomogeneousTuple
[src]

type Item = T

The type of the elements being iterated over.

Auto Trait Implementations

impl<I, T> RefUnwindSafe for Tuples<I, T> where
    I: RefUnwindSafe,
    <T as TupleCollect>::Buffer: RefUnwindSafe

impl<I, T> Send for Tuples<I, T> where
    I: Send,
    <T as TupleCollect>::Buffer: Send

impl<I, T> Sync for Tuples<I, T> where
    I: Sync,
    <T as TupleCollect>::Buffer: Sync

impl<I, T> Unpin for Tuples<I, T> where
    I: Unpin,
    <T as TupleCollect>::Buffer: Unpin

impl<I, T> UnwindSafe for Tuples<I, T> where
    I: UnwindSafe,
    <T as TupleCollect>::Buffer: 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.