Trait Matcher

Source
pub trait Matcher<IN>: Send + Debug
where IN: ?Sized,
{ // Required method fn matches(&mut self, input: &IN) -> bool; }
Expand description

Matcher is just a special case of Mapper that returns a boolean. It simply provides the matches method rather than map as that reads a little better.

There is a blanket implementation for all Mappers that output bool values. You should never implement Matcher yourself, instead implement Mapper with a bool Out parameter.

Required Methods§

Source

fn matches(&mut self, input: &IN) -> bool

true if the input matches.

Implementors§

Source§

impl<T, IN> Matcher<IN> for T
where T: Mapper<IN, Out = bool>,