Trait ChunkBySlice

Source
trait ChunkBySlice<T>:
    AsRef<[T]>
    + Default
    + Send {
    // Required methods
    fn split(self, index: usize) -> (Self, Self);
    fn chunk_by(
        self,
        pred: &impl Fn(&T, &T) -> bool,
    ) -> impl Iterator<Item = Self>;

    // Provided methods
    fn find(
        &self,
        pred: &impl Fn(&T, &T) -> bool,
        start: usize,
        end: usize,
    ) -> Option<usize> { ... }
    fn rfind(&self, pred: &impl Fn(&T, &T) -> bool, end: usize) -> Option<usize> { ... }
}

Required Methods§

Source

fn split(self, index: usize) -> (Self, Self)

Source

fn chunk_by(self, pred: &impl Fn(&T, &T) -> bool) -> impl Iterator<Item = Self>

Provided Methods§

Source

fn find( &self, pred: &impl Fn(&T, &T) -> bool, start: usize, end: usize, ) -> Option<usize>

Source

fn rfind(&self, pred: &impl Fn(&T, &T) -> bool, end: usize) -> Option<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<T: Send> ChunkBySlice<T> for &mut [T]

Source§

fn split(self, index: usize) -> (Self, Self)

Source§

fn chunk_by(self, pred: &impl Fn(&T, &T) -> bool) -> impl Iterator<Item = Self>

Source§

impl<T: Sync> ChunkBySlice<T> for &[T]

Source§

fn split(self, index: usize) -> (Self, Self)

Source§

fn chunk_by(self, pred: &impl Fn(&T, &T) -> bool) -> impl Iterator<Item = Self>

Implementors§