rayon::split_producer

Trait Fissile

Source
pub(crate) trait Fissile<P>: Sized {
    // Required methods
    fn length(&self) -> usize;
    fn midpoint(&self, end: usize) -> usize;
    fn find(&self, separator: &P, start: usize, end: usize) -> Option<usize>;
    fn rfind(&self, separator: &P, end: usize) -> Option<usize>;
    fn split_once<const INCL: bool>(self, index: usize) -> (Self, Self);
    fn fold_splits<F, const INCL: bool>(
        self,
        separator: &P,
        folder: F,
        skip_last: bool,
    ) -> F
       where F: Folder<Self>,
             Self: Send;
}
Expand description

Helper trait so &str, &[T], and &mut [T] can share SplitProducer.

Required Methods§

Source

fn length(&self) -> usize

Source

fn midpoint(&self, end: usize) -> usize

Source

fn find(&self, separator: &P, start: usize, end: usize) -> Option<usize>

Source

fn rfind(&self, separator: &P, end: usize) -> Option<usize>

Source

fn split_once<const INCL: bool>(self, index: usize) -> (Self, Self)

Source

fn fold_splits<F, const INCL: bool>( self, separator: &P, folder: F, skip_last: bool, ) -> F
where F: Folder<Self>, Self: Send,

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<'ch, P: Pattern> Fissile<P> for &'ch str

Implement support for SplitProducer.

Source§

fn length(&self) -> usize

Source§

fn midpoint(&self, end: usize) -> usize

Source§

fn find(&self, separator: &P, start: usize, end: usize) -> Option<usize>

Source§

fn rfind(&self, separator: &P, end: usize) -> Option<usize>

Source§

fn split_once<const INCL: bool>(self, index: usize) -> (Self, Self)

Source§

fn fold_splits<F, const INCL: bool>( self, separator: &P, folder: F, skip_last: bool, ) -> F
where F: Folder<Self>,

Source§

impl<'data, T, P> Fissile<P> for &'data [T]
where P: Fn(&T) -> bool,

Implement support for SplitProducer.

Source§

fn length(&self) -> usize

Source§

fn midpoint(&self, end: usize) -> usize

Source§

fn find(&self, separator: &P, start: usize, end: usize) -> Option<usize>

Source§

fn rfind(&self, separator: &P, end: usize) -> Option<usize>

Source§

fn split_once<const INCL: bool>(self, index: usize) -> (Self, Self)

Source§

fn fold_splits<F, const INCL: bool>( self, separator: &P, folder: F, skip_last: bool, ) -> F
where F: Folder<Self>, Self: Send,

Source§

impl<'data, T, P> Fissile<P> for &'data mut [T]
where P: Fn(&T) -> bool,

Implement support for SplitProducer.

Source§

fn length(&self) -> usize

Source§

fn midpoint(&self, end: usize) -> usize

Source§

fn find(&self, separator: &P, start: usize, end: usize) -> Option<usize>

Source§

fn rfind(&self, separator: &P, end: usize) -> Option<usize>

Source§

fn split_once<const INCL: bool>(self, index: usize) -> (Self, Self)

Source§

fn fold_splits<F, const INCL: bool>( self, separator: &P, folder: F, skip_last: bool, ) -> F
where F: Folder<Self>, Self: Send,

Implementors§