Trait SliceExt

Source
pub trait SliceExt<T> {
    // Required method
    fn chunks_exact_or_repeat(
        &self,
        chunk_size: usize,
    ) -> Either<ChunksExact<'_, T>, Repeat<&[T]>>;
}
Expand description

Extention trait for slices.

Required Methods§

Source

fn chunks_exact_or_repeat( &self, chunk_size: usize, ) -> Either<ChunksExact<'_, T>, Repeat<&[T]>>

Same as chunks_exact but we allow the chunk_size to be zero when the slice is empty.

Implementations on Foreign Types§

Source§

impl<T> SliceExt<T> for [T]

Source§

fn chunks_exact_or_repeat( &self, chunk_size: usize, ) -> Either<ChunksExact<'_, T>, Repeat<&[T]>>

Implementors§