Trait AstNodePattern

Source
pub trait AstNodePattern<Q: QueryContext>:
    Clone
    + Debug
    + Matcher<Q>
    + PatternName
    + Sized {
    const INCLUDES_TRIVIA: bool;

    // Required methods
    fn children<'a>(
        &'a self,
        definitions: &'a StaticDefinitions<'_, Q>,
    ) -> Vec<PatternOrPredicate<'a, Q>>;
    fn matches_kind_of(&self, node: &Q::Node<'_>) -> bool;
}
Expand description

Type of pattern that matches against an individual (non-leaf) AST node.

Required Associated Constants§

Source

const INCLUDES_TRIVIA: bool

Does this AST include trivia? Trivia is useful for being able to re-print an AST, but not all parsers support collecting it.

Required Methods§

Source

fn children<'a>( &'a self, definitions: &'a StaticDefinitions<'_, Q>, ) -> Vec<PatternOrPredicate<'a, Q>>

Source

fn matches_kind_of(&self, node: &Q::Node<'_>) -> bool

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§