Skip to main content

Matcher

Trait Matcher 

Source
pub trait Matcher<Item, Input: ?Sized> {
    // Required method
    fn matches(&self, item: &Item, input: &Input) -> bool;
}
Expand description

Determines whether an item accepts an input.

Matching receives immutable references and should not produce application side effects. Stateful matching can still be configured between calls via Dispatcher::matcher_mut.

Required Methods§

Source

fn matches(&self, item: &Item, input: &Input) -> bool

Returns true when item can handle input.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<Item, Input, F> Matcher<Item, Input> for F
where Input: ?Sized, F: Fn(&Item, &Input) -> bool,