Trait PatternMatchMany

Source
pub trait PatternMatchMany
where Self: PatternMatch,
{ // Provided methods fn pattern_match_all( &self, patterns: &[&str], case_insensitive: bool, ) -> bool { ... } fn pattern_match_all_mixed(&self, pattern_sets: &[(&str, bool)]) -> bool { ... } fn pattern_match_all_conditional( &self, pattern_sets: &[(bool, &str, bool)], ) -> bool { ... } fn pattern_match_all_ci(&self, patterns: &[&str]) -> bool { ... } fn pattern_match_all_cs(&self, patterns: &[&str]) -> bool { ... } fn pattern_match_any( &self, patterns: &[&str], case_insensitive: bool, ) -> bool { ... } fn pattern_match_any_ci(&self, patterns: &[&str]) -> bool { ... } fn pattern_match_any_cs(&self, patterns: &[&str]) -> bool { ... } fn pattern_match_any_mixed(&self, pattern_sets: &[(&str, bool)]) -> bool { ... } fn pattern_match_any_conditional( &self, pattern_sets: &[(bool, &str, bool)], ) -> bool { ... } }
Expand description

Provides methods to match with multiple patterns expressed as arrays of tuples or simple strs (for pattern_match_all_ci and pattern_match_all_cs)

Provided Methods§

Source

fn pattern_match_all(&self, patterns: &[&str], case_insensitive: bool) -> bool

Matches all of the patterns in case-sensitivity flag with an array of tuples (patterns, case_insensitive)

Source

fn pattern_match_all_mixed(&self, pattern_sets: &[(&str, bool)]) -> bool

Matches all of the patterns with case-insensitive flag e.g. (r#"a[ck]"#, true) “ac” or “ak” whether upper, lower or mixed case with an array of tuples (pattern, replacement, case_insensitive) Consider renaming with all

Source

fn pattern_match_all_conditional( &self, pattern_sets: &[(bool, &str, bool)], ) -> bool

Matches all of the patterns with positivity condition and case-insensitive flag e.g. (false, "a[ck]", true) does not contain “ac” or “ak” whether upper, lower or mixed case with an array of tuples (positive, pattern, case_insensitive)

Source

fn pattern_match_all_ci(&self, patterns: &[&str]) -> bool

Matches all of the patterns in case-insensitive mode with an array of str patterns

Source

fn pattern_match_all_cs(&self, patterns: &[&str]) -> bool

Matches all of the patterns in case-sensitive mode with an array of str patterns

Source

fn pattern_match_any(&self, patterns: &[&str], case_insensitive: bool) -> bool

Matches one or more of the patterns in case-sensitivity flag with an array of tuples (patterns, case_insensitive)

Source

fn pattern_match_any_ci(&self, patterns: &[&str]) -> bool

Matches one or more of the patterns in case-insensitive mode with an array of str patterns

Source

fn pattern_match_any_cs(&self, patterns: &[&str]) -> bool

Matches one or more of the patterns in case-sensitive mode with an array of str patterns

Source

fn pattern_match_any_mixed(&self, pattern_sets: &[(&str, bool)]) -> bool

Matches one or more of the patterns with case-insensitive flag e.g. (r#"a[ck]"#, true) matches “ac” or “ak” whether upper, lower or mixed case with an array of tuples (pattern, replacement, case_insensitive)

Source

fn pattern_match_any_conditional( &self, pattern_sets: &[(bool, &str, bool)], ) -> bool

Matches one or more of the patterns with positivity condition and case-insensitive flag

Implementations on Foreign Types§

Source§

impl PatternMatchMany for str

Implement PatternMatchMany for &str/String

Source§

impl PatternMatchMany for [&str]

Implement PatternMatchMany for vectors of strings.

Implementors§