rayon::str::private

Trait Pattern

Source
pub trait Pattern:
    Sized
    + Sync
    + Send {
    // Required methods
    fn find_in(&self, haystack: &str) -> Option<usize>;
    fn rfind_in(&self, haystack: &str) -> Option<usize>;
    fn is_suffix_of(&self, haystack: &str) -> bool;
    fn fold_splits<'ch, F>(
        &self,
        haystack: &'ch str,
        folder: F,
        skip_last: bool,
    ) -> F
       where F: Folder<&'ch str>;
    fn fold_inclusive_splits<'ch, F>(&self, haystack: &'ch str, folder: F) -> F
       where F: Folder<&'ch str>;
    fn fold_matches<'ch, F>(&self, haystack: &'ch str, folder: F) -> F
       where F: Folder<&'ch str>;
    fn fold_match_indices<'ch, F>(
        &self,
        haystack: &'ch str,
        folder: F,
        base: usize,
    ) -> F
       where F: Folder<(usize, &'ch str)>;
}
Expand description

Pattern-matching trait for ParallelString, somewhat like a mix of std::str::pattern::{Pattern, Searcher}.

Implementing this trait is not permitted outside of rayon.

Required Methods§

Source

fn find_in(&self, haystack: &str) -> Option<usize>

Source

fn rfind_in(&self, haystack: &str) -> Option<usize>

Source

fn is_suffix_of(&self, haystack: &str) -> bool

Source

fn fold_splits<'ch, F>( &self, haystack: &'ch str, folder: F, skip_last: bool, ) -> F
where F: Folder<&'ch str>,

Source

fn fold_inclusive_splits<'ch, F>(&self, haystack: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source

fn fold_matches<'ch, F>(&self, haystack: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source

fn fold_match_indices<'ch, F>( &self, haystack: &'ch str, folder: F, base: usize, ) -> F
where F: Folder<(usize, &'ch str)>,

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 Pattern for &[char]

Source§

fn find_in(&self, chars: &str) -> Option<usize>

Source§

fn rfind_in(&self, chars: &str) -> Option<usize>

Source§

fn is_suffix_of(&self, chars: &str) -> bool

Source§

fn fold_splits<'ch, F>(&self, chars: &'ch str, folder: F, skip_last: bool) -> F
where F: Folder<&'ch str>,

Source§

fn fold_inclusive_splits<'ch, F>(&self, chars: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source§

fn fold_matches<'ch, F>(&self, chars: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source§

fn fold_match_indices<'ch, F>( &self, chars: &'ch str, folder: F, base: usize, ) -> F
where F: Folder<(usize, &'ch str)>,

Source§

impl Pattern for char

Source§

fn find_in(&self, chars: &str) -> Option<usize>

Source§

fn rfind_in(&self, chars: &str) -> Option<usize>

Source§

fn is_suffix_of(&self, chars: &str) -> bool

Source§

fn fold_splits<'ch, F>(&self, chars: &'ch str, folder: F, skip_last: bool) -> F
where F: Folder<&'ch str>,

Source§

fn fold_inclusive_splits<'ch, F>(&self, chars: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source§

fn fold_matches<'ch, F>(&self, chars: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source§

fn fold_match_indices<'ch, F>( &self, chars: &'ch str, folder: F, base: usize, ) -> F
where F: Folder<(usize, &'ch str)>,

Source§

impl<const N: usize> Pattern for &[char; N]

Source§

fn find_in(&self, chars: &str) -> Option<usize>

Source§

fn rfind_in(&self, chars: &str) -> Option<usize>

Source§

fn is_suffix_of(&self, chars: &str) -> bool

Source§

fn fold_splits<'ch, F>(&self, chars: &'ch str, folder: F, skip_last: bool) -> F
where F: Folder<&'ch str>,

Source§

fn fold_inclusive_splits<'ch, F>(&self, chars: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source§

fn fold_matches<'ch, F>(&self, chars: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source§

fn fold_match_indices<'ch, F>( &self, chars: &'ch str, folder: F, base: usize, ) -> F
where F: Folder<(usize, &'ch str)>,

Source§

impl<const N: usize> Pattern for [char; N]

Source§

fn find_in(&self, chars: &str) -> Option<usize>

Source§

fn rfind_in(&self, chars: &str) -> Option<usize>

Source§

fn is_suffix_of(&self, chars: &str) -> bool

Source§

fn fold_splits<'ch, F>(&self, chars: &'ch str, folder: F, skip_last: bool) -> F
where F: Folder<&'ch str>,

Source§

fn fold_inclusive_splits<'ch, F>(&self, chars: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source§

fn fold_matches<'ch, F>(&self, chars: &'ch str, folder: F) -> F
where F: Folder<&'ch str>,

Source§

fn fold_match_indices<'ch, F>( &self, chars: &'ch str, folder: F, base: usize, ) -> F
where F: Folder<(usize, &'ch str)>,

Implementors§

Source§

impl<FN: Sync + Send + Fn(char) -> bool> Pattern for FN