itertools::tuple_impl

Trait TupleCollect

Source
pub trait TupleCollect: Sized {
    type Item;
    type Buffer: Default + AsRef<[Option<Self::Item>]> + AsMut<[Option<Self::Item>]>;

    // Required methods
    fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
       where I: IntoIterator<Item = Self::Item>;
    fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
       where I: IntoIterator<Item = Self::Item>;
    fn num_items() -> usize;
    fn left_shift_push(&mut self, item: Self::Item);

    // Provided method
    fn buffer_len(buf: &Self::Buffer) -> usize { ... }
}

Required Associated Types§

Source

type Item

Source

type Buffer: Default + AsRef<[Option<Self::Item>]> + AsMut<[Option<Self::Item>]>

Required Methods§

Source

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = Self::Item>,

Source

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = Self::Item>,

Source

fn num_items() -> usize

Source

fn left_shift_push(&mut self, item: Self::Item)

Provided Methods§

Source

fn buffer_len(buf: &Self::Buffer) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<A> TupleCollect for (A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 1]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 2]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 3]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 4]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 5]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 6]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A, A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 7]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 8]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 9]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 10]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A, A, A)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 11]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Source§

impl<A> TupleCollect for (A,)

Source§

type Item = A

Source§

type Buffer = [Option<A>; 0]

Source§

fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>
where I: IntoIterator<Item = A>,

Source§

fn num_items() -> usize

Source§

fn left_shift_push(&mut self, item: A)

Implementors§