pub struct Node {
pub id: usize,
pub parent: Option<usize>,
pub range: Range<usize>,
pub children: Vec<Child>,
pub ancestors: Vec<String>,
pub depth: usize,
}Expand description
Node metadata shared by parser adapters, using UTF-8 byte offsets.
Fields§
§id: usizeIDs are unique within one parsed tree, not across injection layers.
parent: Option<usize>Parent node ID within the same tree, populated when requested by the query.
range: Range<usize>Half-open UTF-8 byte range in the original source.
children: Vec<Child>Immediate children in source order.
ancestors: Vec<String>Ancestor node kinds, nearest first, for structural query predicates.
depth: usizeNumeric ancestor depth, populated when requested by the query.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Node
impl Freeze for Node
impl Move for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more