pub struct CapturedNode<'tree> { /* private fields */ }Expand description
A captured AST node with a reference to the source.
Implementations§
Source§impl<'tree> CapturedNode<'tree>
impl<'tree> CapturedNode<'tree>
Sourcepub fn new(node: Node<'tree>, source: &'tree str) -> Self
pub fn new(node: Node<'tree>, source: &'tree str) -> Self
Create from a tree-sitter node and source text.
pub fn start_byte(&self) -> usize
pub fn end_byte(&self) -> usize
pub fn start_point(&self) -> (usize, usize)
pub fn end_point(&self) -> (usize, usize)
pub fn kind(&self) -> &'tree str
Trait Implementations§
Source§impl<'tree> Clone for CapturedNode<'tree>
impl<'tree> Clone for CapturedNode<'tree>
Source§fn clone(&self) -> CapturedNode<'tree>
fn clone(&self) -> CapturedNode<'tree>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'tree> Debug for CapturedNode<'tree>
impl<'tree> Debug for CapturedNode<'tree>
Source§impl PartialEq for CapturedNode<'_>
impl PartialEq for CapturedNode<'_>
Source§impl Serialize for CapturedNode<'_>
impl Serialize for CapturedNode<'_>
impl<'tree> Copy for CapturedNode<'tree>
impl Eq for CapturedNode<'_>
Auto Trait Implementations§
impl<'tree> Freeze for CapturedNode<'tree>
impl<'tree> RefUnwindSafe for CapturedNode<'tree>
impl<'tree> Send for CapturedNode<'tree>
impl<'tree> Sync for CapturedNode<'tree>
impl<'tree> Unpin for CapturedNode<'tree>
impl<'tree> UnwindSafe for CapturedNode<'tree>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.