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§
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 Methods§
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".
Implementations on Foreign Types§
Source§impl<A> TupleCollect for (A, A)
impl<A> TupleCollect for (A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 1]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A)
impl<A> TupleCollect for (A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 2]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A)
impl<A> TupleCollect for (A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 3]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A, A)
impl<A> TupleCollect for (A, A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 4]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A, A, A)
impl<A> TupleCollect for (A, A, A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 5]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A, A, A, A)
impl<A> TupleCollect for (A, A, A, A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 6]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A, A, A, A, A)
impl<A> TupleCollect for (A, A, A, A, A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 7]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A)
impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 8]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A)
impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 9]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A, A)
impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 10]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A, A, A)
impl<A> TupleCollect for (A, A, A, A, A, A, A, A, A, A, A, A)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.
type Item = A
type Buffer = [Option<A>; 11]
fn collect_from_iter<I>(iter: I, buf: &mut Self::Buffer) -> Option<Self>where
I: IntoIterator<Item = A>,
fn collect_from_iter_no_buf<I>(iter: I) -> Option<Self>where
I: IntoIterator<Item = A>,
fn num_items() -> usize
Source§impl<A> TupleCollect for (A,)
impl<A> TupleCollect for (A,)
Source§fn left_shift_push(&mut self, item: A)
fn left_shift_push(&mut self, item: A)
Shift all elements one position to the left and push the new item to the end.