pub struct ArrayChunks<I, const N: usize>where
I: Bulk,{ /* private fields */ }Expand description
A bulk over N elements of the bulk at a time.
The chunks do not overlap. If N does not divide the length of the
iterator, then the last up to N-1 elements will be omitted.
This struct is created by the array_chunks
method on Bulk. See its documentation for more.
Implementations§
Source§impl<I, const N: usize> ArrayChunks<I, N>where
I: Bulk,
impl<I, const N: usize> ArrayChunks<I, N>where
I: Bulk,
pub const fn for_each_with_remainder<F>( self, f: F, ) -> <ArrayBuffer<I::Item, N, false> as IntoBulk>::IntoBulk
pub const fn try_for_each_with_remainder<F, R, RR>(self, f: F) -> RRwhere
I: Bulk<Item>,
F: FnMut(<Self as IntoIterator>::Item) -> R,
R: Try<Output = (), Residual: Residual<<ArrayBuffer<I::Item, N, false> as IntoBulk>::IntoBulk, TryType = RR>>,
RR: Try<Output = <ArrayBuffer<I::Item, N, false> as IntoBulk>::IntoBulk, Residual = R::Residual>,
ArrayBuffer<I::Item, N, false>: IntoBulk,
pub const fn collect_with_remainder<B, L = <B as CollectLength<<Self as IntoIterator>::Item>>::Length>(
self,
) -> (B, <ArrayBuffer<I::Item, N, false> as IntoBulk>::IntoBulk)where
I: Bulk<Item>,
B: for<'a> FromBulk<<Self as IntoIterator>::Item, ArrayChunksWithRemainder<'a, I, N, false>, L>,
L: Length<Elem = <Self as IntoIterator>::Item> + ?Sized,
ArrayBuffer<I::Item, N, false>: IntoBulk,
Trait Implementations§
Source§impl<I, const N: usize> Bulk for ArrayChunks<I, N>where
I: Bulk<Item>,
impl<I, const N: usize> Bulk for ArrayChunks<I, N>where
I: Bulk<Item>,
Source§fn try_for_each<F, R>(self, f: F) -> R
fn try_for_each<F, R>(self, f: F) -> R
A bulk method that applies a fallible function to each item in the
bulk, stopping at the first error and returning that error. Read more
Source§fn first(self) -> Option<Self::Item>
fn first(self) -> Option<Self::Item>
Returns the first value, and discards the rest of the bulk. Read more
Source§fn last(self) -> Option<Self::Item>
fn last(self) -> Option<Self::Item>
Returns the last value, and discards the rest of the bulk. Read more
Source§fn nth<L>(self, n: L) -> Option<Self::Item>
fn nth<L>(self, n: L) -> Option<Self::Item>
Returns the
n-th value, and discards the rest of the bulk. Read moreSource§fn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation,
returning the final result. Read more
Source§fn try_reduce<F, R>(
self,
f: F,
) -> <R::Residual as Residual<Option<R::Output>>>::TryType
fn try_reduce<F, R>( self, f: F, ) -> <R::Residual as Residual<Option<R::Output>>>::TryType
TODO
Source§fn step_by<L>(self, step: L) -> StepBy<Self, L::Length<Self::Item>> ⓘwhere
Self: Sized,
L: LengthSpec,
fn step_by<L>(self, step: L) -> StepBy<Self, L::Length<Self::Item>> ⓘwhere
Self: Sized,
L: LengthSpec,
Creates a bulk starting at the same point, but stepping by
the given amount at each iteration. Read more
Source§fn chain<U>(self, other: U) -> Chain<Self, U::IntoBulk> ⓘ
fn chain<U>(self, other: U) -> Chain<Self, U::IntoBulk> ⓘ
Takes two bulks and creates a new bulk over both in sequence. Read more
Source§fn zip<U>(
self,
other: U,
) -> Zip<Self, <<U as IntoContained>::IntoContained as IntoBulk>::IntoBulk> ⓘwhere
Self: Sized,
U: IntoContainedBy<Self>,
fn zip<U>(
self,
other: U,
) -> Zip<Self, <<U as IntoContained>::IntoContained as IntoBulk>::IntoBulk> ⓘwhere
Self: Sized,
U: IntoContainedBy<Self>,
‘Zips up’ two bulks or iterators into a single bulk of pairs. One of them must be a bulk. Read more
Source§fn intersperse(self, separator: Self::Item) -> Intersperse<Self> ⓘ
fn intersperse(self, separator: Self::Item) -> Intersperse<Self> ⓘ
Creates a new bulk which places a copy of
separator between adjacent
items of the original bulk. Read moreSource§fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> ⓘ
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> ⓘ
Creates a new bulk which places an item generated by
separator
between adjacent items of the original bulk. Read moreSource§fn map<B, F>(self, f: F) -> Map<Self, F> ⓘ
fn map<B, F>(self, f: F) -> Map<Self, F> ⓘ
Takes a closure and creates a bulk which calls that closure on each
element. Read more
Source§fn enumerate(self) -> Enumerate<Self> ⓘwhere
Self: Sized,
fn enumerate(self) -> Enumerate<Self> ⓘwhere
Self: Sized,
Creates a bulk which gives the current index together with its values. Read more
Source§fn enumerate_from<U>(self, initial_count: U) -> EnumerateFrom<Self, U> ⓘ
fn enumerate_from<U>(self, initial_count: U) -> EnumerateFrom<Self, U> ⓘ
Creates a bulk which gives the current index counting from a given initial index together with its values. Read more
Source§fn skip<L>(self, n: L) -> Skip<Self, L::Length<Self::Item>> ⓘwhere
Self: Sized,
L: LengthSpec,
fn skip<L>(self, n: L) -> Skip<Self, L::Length<Self::Item>> ⓘwhere
Self: Sized,
L: LengthSpec,
Creates a bulk that skips the first
n elements. Read moreSource§fn take<L>(self, n: L) -> Take<Self, L::Length<Self::Item>> ⓘwhere
Self: Sized,
L: LengthSpec,
fn take<L>(self, n: L) -> Take<Self, L::Length<Self::Item>> ⓘwhere
Self: Sized,
L: LengthSpec,
Creates a bulk for the first
n elements, or fewer
if the underlying bulk/iterator is shorter. Read moreSource§fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> ⓘ
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> ⓘ
Creates a bulk that works like map, but flattens nested structure. Read more
Source§fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N> ⓘ
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N> ⓘ
Calls the given function
f for each contiguous window of size N over
self and returns a bulk of the outputs of f. The windows during mapping will overlap. Read moreSource§fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
Does something with each element of a bulk, passing the value on. Read more
Source§fn mutate<F>(self, f: F) -> Mutate<Self, F> ⓘ
fn mutate<F>(self, f: F) -> Mutate<Self, F> ⓘ
Mutates with each element of a bulk, passing the value on. Read more
Source§fn collect<B, L = <B as CollectLength<<Self as IntoIterator>::Item>>::Length>(
self,
) -> B
fn collect<B, L = <B as CollectLength<<Self as IntoIterator>::Item>>::Length>( self, ) -> B
Transforms a bulk into a collection. Read more
Source§fn try_collect<B, L = <B as CollectLength<<<Self as IntoIterator>::Item as Try>::Output>>::Length>(
self,
) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
fn try_collect<B, L = <B as CollectLength<<<Self as IntoIterator>::Item as Try>::Output>>::Length>( self, ) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
Fallibly transforms a bulk into a collection, short circuiting if
a failure is encountered. Read more
Source§fn collect_array(
self,
) -> <Self as StaticBulk>::Array<<Self as IntoIterator>::Item>where
Self: StaticBulk,
fn collect_array(
self,
) -> <Self as StaticBulk>::Array<<Self as IntoIterator>::Item>where
Self: StaticBulk,
Transforms a statically sized bulk into an array.
The bulk must implement
StaticBulk. Read moreSource§fn try_collect_array(
self,
) -> <<Self::Item as Try>::Residual as Residual<Self::Array<<Self::Item as Try>::Output>>>::TryType
fn try_collect_array( self, ) -> <<Self::Item as Try>::Residual as Residual<Self::Array<<Self::Item as Try>::Output>>>::TryType
Fallibly transforms a statically sized bulk into an array, short circuiting if
a failure is encountered.
The bulk must implement
StaticBulk. Read moreSource§fn rev(self) -> Rev<Self> ⓘwhere
Self: Sized + DoubleEndedBulk,
fn rev(self) -> Rev<Self> ⓘwhere
Self: Sized + DoubleEndedBulk,
Reverses a bulks’s direction. Read more
Source§fn copied<'a, T>(self) -> Copied<Self> ⓘ
fn copied<'a, T>(self) -> Copied<Self> ⓘ
Creates a bulk which copies all of its elements. Read more
Source§fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> ⓘwhere
Self: Sized,
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> ⓘwhere
Self: Sized,
Returns a bulk of
N elements of the bulk at a time. Read moreSource§impl<I, const N: usize> Clone for ArrayChunks<I, N>
impl<I, const N: usize> Clone for ArrayChunks<I, N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<I, const N: usize> Debug for ArrayChunks<I, N>
impl<I, const N: usize> Debug for ArrayChunks<I, N>
Source§impl<I, const N: usize> DoubleEndedBulk for ArrayChunks<I, N>where
I: DoubleEndedBulk<Item> + Bulk,
impl<I, const N: usize> DoubleEndedBulk for ArrayChunks<I, N>where
I: DoubleEndedBulk<Item> + Bulk,
Source§fn rev_for_each<F>(self, f: F)
fn rev_for_each<F>(self, f: F)
Calls a closure on each element of a bulk in reverse.
Source§impl<I, const N: usize> IntoIterator for ArrayChunks<I, N>where
I: Bulk,
impl<I, const N: usize> IntoIterator for ArrayChunks<I, N>where
I: Bulk,
Source§impl<I, const N: usize, L> SplitBulk<L> for ArrayChunks<I, N>
impl<I, const N: usize, L> SplitBulk<L> for ArrayChunks<I, N>
Source§impl<I, T, const N: usize, const M: usize> StaticBulk for ArrayChunks<I, N>
impl<I, T, const N: usize, const M: usize> StaticBulk for ArrayChunks<I, N>
type Array<U> = [U; { _ }]
Auto Trait Implementations§
impl<I, const N: usize> Freeze for ArrayChunks<I, N>where
I: Freeze,
impl<I, const N: usize> RefUnwindSafe for ArrayChunks<I, N>where
I: RefUnwindSafe,
impl<I, const N: usize> Send for ArrayChunks<I, N>where
I: Send,
impl<I, const N: usize> Sync for ArrayChunks<I, N>where
I: Sync,
impl<I, const N: usize> Unpin for ArrayChunks<I, N>where
I: Unpin,
impl<I, const N: usize> UnwindSafe for ArrayChunks<I, N>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more