XMatch

Trait XMatch 

Source
pub trait XMatch<'l> {
    type Out: Copy;

    // Required method
    fn go<M>(
        &self,
        direction: &M,
        ll_line: &'l LLLine,
    ) -> Vec<(Self::Out, ToIdx)>
       where M: XDirection<'l>;
}
Expand description

Examples: Attr, AttrEq

Required Associated Types§

Source

type Out: Copy

Usually must be Copy so it’s compatible with any multi-matchers. The Out must be copied in the event of “cartesian” product scenarios where multi-matchers return multiple combinations of their inner matchers’ Out.

This usually isn’t a big deal to implement, since most Out values will be a reference like &'l Tag, and all references in Rust are Copy.

Required Methods§

Source

fn go<M>(&self, direction: &M, ll_line: &'l LLLine) -> Vec<(Self::Out, ToIdx)>
where M: XDirection<'l>,

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<'l> XMatch<'l> for TokenText

Source§

type Out = &'l str

Source§

impl<'l, A: 'static> XMatch<'l> for Attr<A>

Source§

impl<'l, A: XMatch<'l>, B: XMatch<'l>> XMatch<'l> for All2<A, B>

Source§

type Out = (<A as XMatch<'l>>::Out, <B as XMatch<'l>>::Out)

Source§

impl<'l, A: XMatch<'l>, B: XMatch<'l>> XMatch<'l> for AnyOf2Matcher<A, B>

Source§

type Out = AnyOf2<<A as XMatch<'l>>::Out, <B as XMatch<'l>>::Out>

Source§

impl<'l, A: XMatch<'l>, B: XMatch<'l>> XMatch<'l> for Seq2<A, B>

Source§

type Out = (<A as XMatch<'l>>::Out, <B as XMatch<'l>>::Out)

Source§

impl<'l, A: XMatch<'l>, B: XMatch<'l>, C: XMatch<'l>> XMatch<'l> for All3<A, B, C>

Source§

type Out = (<A as XMatch<'l>>::Out, <B as XMatch<'l>>::Out, <C as XMatch<'l>>::Out)

Source§

impl<'l, A: XMatch<'l>, B: XMatch<'l>, C: XMatch<'l>> XMatch<'l> for AnyOf3Matcher<A, B, C>

Source§

type Out = AnyOf3<<A as XMatch<'l>>::Out, <B as XMatch<'l>>::Out, <C as XMatch<'l>>::Out>

Source§

impl<'l, A: XMatch<'l>, B: XMatch<'l>, C: XMatch<'l>> XMatch<'l> for Seq3<A, B, C>

Source§

type Out = (<A as XMatch<'l>>::Out, <B as XMatch<'l>>::Out, <C as XMatch<'l>>::Out)

Source§

impl<'l, Attr: PartialEq + 'static> XMatch<'l> for AttrEq<'_, Attr>

Source§

impl<'l, Attr: PartialEq + 'static> XMatch<'l> for TokenHasAny<'_, Attr>