pub trait Pattern {
// Required method
fn is_matching(&self, val: char) -> bool;
}
Expand description
While https://github.com/rust-lang/rust/issues/27721 is pending we need to define
our own minimal Pattern
trait.
Pattern type | Match condition |
---|---|
char | is contained in string |
&[char] | any char in slice is contained in string |
F: FnMut(char) -> bool | F returns true for a char in string |
Required Methods§
Sourcefn is_matching(&self, val: char) -> bool
fn is_matching(&self, val: char) -> bool
Returns whether the character is matching the pattern.