pub trait SliceExt {
    type Item;

    // Required methods
    fn uarray_chunks<const SIZE: usize>(
        &self
    ) -> ArrayChunks<'_, Self::Item, SIZE> ;
    fn uarray_chunks_mut<const SIZE: usize>(
        &mut self
    ) -> ArrayChunksMut<'_, Self::Item, SIZE> ;
}

Required Associated Types§

Required Methods§

source

fn uarray_chunks<const SIZE: usize>(&self) -> ArrayChunks<'_, Self::Item, SIZE>

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be retrieved from the remainder function of the iterator.

Note: this function is designed to be equivalent to the currently unstable core::slice::array_chunks.

source

fn uarray_chunks_mut<const SIZE: usize>( &mut self ) -> ArrayChunksMut<'_, Self::Item, SIZE>

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be retrieved from the into_remainder function of the iterator.

Note: this function is designed to be equivalent to the currently unstable core::slice::array_chunks_mut.

Implementations on Foreign Types§

source§

impl<T> SliceExt for [T]

§

type Item = T

source§

fn uarray_chunks<const SIZE: usize>(&self) -> ArrayChunks<'_, Self::Item, SIZE>

source§

fn uarray_chunks_mut<const SIZE: usize>( &mut self ) -> ArrayChunksMut<'_, Self::Item, SIZE>

Implementors§