Matcher

Trait Matcher 

Source
pub trait Matcher:
    Send
    + Sync
    + 'static {
    type View<'a>;

    // Required method
    fn try_match(parent: &Expression) -> Option<Self::View<'_>>;
}
Expand description

Trait that abstracts over matching on expression types.

Required Associated Types§

Source

type View<'a>

The view type returned when matching succeeds.

Required Methods§

Source

fn try_match(parent: &Expression) -> Option<Self::View<'_>>

Try to match/downcast the parent expression. Returns Some if the parent matches this matcher’s criteria, None otherwise.

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 Matcher for AnyScalarFn

Source§

type View<'a> = &'a ScalarFn

Source§

impl Matcher for Any

Source§

type View<'a> = &'a Expression

Source§

impl<F: VTable> Matcher for ExactScalarFn<F>

Source§

type View<'a> = &'a <F as VTable>::Options

Source§

impl<V: VTable> Matcher for Exact<V>

Source§

type View<'a> = ExpressionView<'a, V>