pub struct QueryCursor { /* private fields */ }
Expand description

A stateful object for executing a Query on a syntax Tree.

Implementations

Create a new cursor for executing a given query.

The cursor stores the state that is needed to iteratively search for matches.

Return the maximum number of in-progress matches for this cursor.

Set the maximum number of in-progress matches for this cursor. The limit must be > 0 and <= 65536.

Check if, on its last execution, this cursor exceeded its maximum number of in-progress matches.

Iterate over all of the matches in the order that they were found.

Each match contains the index of the pattern that matched, and a list of captures. Because multiple patterns can match the same set of nodes, one match may contain captures that appear before some of the captures from a previous match.

Iterate over all of the individual captures in the order that they appear.

This is useful if you don’t care about which pattern matched, and just want a single, ordered sequence of captures.

Set the range in which the query will be executed, in terms of byte offsets.

Set the range in which the query will be executed, in terms of rows and columns.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.