Struct tree_sitter::TreeCursor [−][src]
pub struct TreeCursor<'a>(_, _);
Expand description
A stateful object for walking a syntax Tree
efficiently.
Implementations
impl<'a> TreeCursor<'a>
[src]
impl<'a> TreeCursor<'a>
[src]pub fn field_id(&self) -> Option<u16>
[src]
pub fn field_id(&self) -> Option<u16>
[src]Get the numerical field id of this tree cursor’s current node.
See also field_name.
pub fn field_name(&self) -> Option<&'static str>
[src]
pub fn field_name(&self) -> Option<&'static str>
[src]Get the field name of this tree cursor’s current node.
pub fn goto_first_child(&mut self) -> bool
[src]
pub fn goto_first_child(&mut self) -> bool
[src]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.
pub fn goto_parent(&mut self) -> bool
[src]
pub fn goto_parent(&mut self) -> bool
[src]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).
pub fn goto_next_sibling(&mut self) -> bool
[src]
pub fn goto_next_sibling(&mut self) -> bool
[src]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.
pub fn goto_first_child_for_byte(&mut self, index: usize) -> Option<usize>
[src]
pub fn goto_first_child_for_byte(&mut self, index: usize) -> Option<usize>
[src]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.
Trait Implementations
impl<'a> Clone for TreeCursor<'a>
[src]
impl<'a> Clone for TreeCursor<'a>
[src]Auto Trait Implementations
impl<'a> RefUnwindSafe for TreeCursor<'a>
impl<'a> !Send for TreeCursor<'a>
impl<'a> !Sync for TreeCursor<'a>
impl<'a> Unpin for TreeCursor<'a>
impl<'a> UnwindSafe for TreeCursor<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more