pub struct TreeCursor<'a>(_, _);
Expand description

A stateful object for walking a syntax Tree efficiently.

Implementations

Get the tree cursor’s current Node.

Get the numerical field id of this tree cursor’s current node.

See also field_name.

Get the field name of this tree cursor’s current node.

Move this cursor to the first child of its current node.

This returns true if the cursor successfully moved, and returns false if there were no children.

Move this cursor to the parent of its current node.

This returns true if the cursor successfully moved, and returns false if there was no parent node (the cursor was already on the root node).

Move this cursor to the next sibling of its current node.

This returns true if the cursor successfully moved, and returns false if there was no next sibling node.

Move this cursor to the first child of its current node that extends beyond the given byte offset.

This returns the index of the child node if one was found, and returns None if no such child was found.

Move this cursor to the first child of its current node that extends beyond the given byte offset.

This returns the index of the child node if one was found, and returns None if no such child was found.

Re-initialize this tree cursor to start at a different node.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
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 resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.