Trait Pattern

Source
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 typeMatch condition
charis contained in string
&[char]any char in slice is contained in string
F: FnMut(char) -> boolF returns true for a char in string

Required Methods§

Source

fn is_matching(&self, val: char) -> bool

Returns whether the character is matching the pattern.

Implementations on Foreign Types§

Source§

impl Pattern for &[char]

Source§

fn is_matching(&self, val: char) -> bool

Source§

impl Pattern for char

Source§

fn is_matching(&self, val: char) -> bool

Implementors§

Source§

impl<F: Fn(char) -> bool> Pattern for F

OSZAR »