Matcher

Trait Matcher 

Source
pub trait Matcher<Ctx: ?Sized>: MaybeSend + MaybeSync {
    // Required method
    fn compile(&self, value: &JsonValue) -> Result<Operator<Ctx>, Error>;

    // Provided method
    fn json_schema(&self, custom_ops: &[(&str, JsonValue)]) -> JsonValue { ... }
}
Expand description

Trait for types matchers

Required Methods§

Source

fn compile(&self, value: &JsonValue) -> Result<Operator<Ctx>, Error>

Compiles the JSON configuration and returns an Operator.

Provided Methods§

Source

fn json_schema(&self, custom_ops: &[(&str, JsonValue)]) -> JsonValue

Returns a JSON Schema that describes valid inputs for this matcher.

Implementors§

Source§

impl<Ctx: ?Sized> Matcher<Ctx> for BoolMatcher

Source§

impl<Ctx: ?Sized> Matcher<Ctx> for DefaultMatcher

Source§

impl<Ctx: ?Sized> Matcher<Ctx> for IpMatcher

Source§

impl<Ctx: ?Sized> Matcher<Ctx> for NumberMatcher

Source§

impl<Ctx: ?Sized> Matcher<Ctx> for RegexMatcher

Source§

impl<Ctx: ?Sized> Matcher<Ctx> for StringMatcher