Trait QuestionMatcher

Source
pub trait QuestionMatcher
where Self: Sized,
{ // Required methods fn parse<S: AsRef<str>>(patterns: &[S]) -> Result<Self, ParseError>; fn test(&self, label: &Label) -> bool; }
Expand description

Parses the question, and tests it aganinst given full-context label.

Required Methods§

Source

fn parse<S: AsRef<str>>(patterns: &[S]) -> Result<Self, ParseError>

Parses question patterns in string, and if succeeds, returns the parsed question.

Source

fn test(&self, label: &Label) -> bool

Checks if the full-context label matches the question.

If you want to test on string label, parse it using Label::from_str() beforehand.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl QuestionMatcher for AllQuestion

Source§

impl QuestionMatcher for RegexQuestion

Available on crate feature regex only.