Trait Rule

Source
pub trait Rule: Debug + Spanned {
    // Required methods
    fn kind(&self) -> Check;
    fn apply<'input, 'context, C>(
        &self,
        context: &mut C,
    ) -> DiagResult<Matches<'input>>
       where C: Context<'input, 'context> + ?Sized;
}

Required Methods§

Source

fn kind(&self) -> Check

Source

fn apply<'input, 'context, C>( &self, context: &mut C, ) -> DiagResult<Matches<'input>>
where C: Context<'input, 'context> + ?Sized,

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.

Implementations on Foreign Types§

Source§

impl<'r, R> Rule for &'r R
where R: ?Sized + Rule,

Source§

fn kind(&self) -> Check

Source§

fn apply<'input, 'context, C>( &self, context: &mut C, ) -> DiagResult<Matches<'input>>
where C: Context<'input, 'context> + ?Sized,

Source§

impl<R> Rule for Box<R>
where R: Rule + ?Sized,

Source§

fn kind(&self) -> Check

Source§

fn apply<'input, 'context, C>( &self, context: &mut C, ) -> DiagResult<Matches<'input>>
where C: Context<'input, 'context> + ?Sized,

Implementors§

Source§

impl Rule for CheckEmpty

Source§

impl<'check> Rule for CheckDag<'check>

Source§

impl<'context> Rule for dyn DynRule + 'context

Source§

impl<M> Rule for CheckNext<M>
where M: MatcherMut,

Source§

impl<M> Rule for CheckPlain<M>
where M: MatcherMut,

Source§

impl<M> Rule for CheckSame<M>
where M: MatcherMut,