QueryMatch

Trait QueryMatch 

Source
pub trait QueryMatch<'query, 'tree: 'query>: Debug {
    type Query: Query<Match<'query, 'tree> = Self>;

    // Required methods
    fn query(&self) -> &'query Self::Query;
    fn raw(&self) -> &QueryMatch<'query, 'tree>;
    fn into_raw(self) -> QueryMatch<'query, 'tree>;

    // Provided methods
    fn captures(&self) -> QueryMatchCaptures<'query, 'tree, Self::Query> { ... }
    fn remove(self)
       where Self: Sized,
             'tree: 'query { ... }
}
Expand description

A match from a Query with typed nodes

Required Associated Types§

Source

type Query: Query<Match<'query, 'tree> = Self>

The type of query this match came from

Required Methods§

Source

fn query(&self) -> &'query Self::Query

The query this match came from

Source

fn raw(&self) -> &QueryMatch<'query, 'tree>

The underlying tree-sitter QueryMatch

Source

fn into_raw(self) -> QueryMatch<'query, 'tree>

Destruct into the underlying tree-sitter QueryMatch

Provided Methods§

Source

fn captures(&self) -> QueryMatchCaptures<'query, 'tree, Self::Query>

Source

fn remove(self)
where Self: Sized, 'tree: 'query,

Remove the match (honestly I don’t know what this does because it’s not documented)

Implementors§