Skip to main content

MatchOccurrences

Trait MatchOccurrences 

Source
pub trait MatchOccurrences {
    // Required methods
    fn find_matched_indices(&self, pat: &str) -> Vec<usize>;
    fn find_char_indices(&self, pat: char) -> Vec<usize>;
}
Expand description

Return the indices of all ocurrences of a string

Required Methods§

Source

fn find_matched_indices(&self, pat: &str) -> Vec<usize>

Return the indices only of all matches of a given string pattern (not a regular expression) Builds on match_indices in the Rust standard library

Source

fn find_char_indices(&self, pat: char) -> Vec<usize>

Match occurrences of a single character

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§