pub struct SyntaxNode { /* private fields */ }Expand description
A node’s children retain source order. Each token occurs in exactly one leaf.
Implementations§
Source§impl SyntaxNode
impl SyntaxNode
pub fn kind(&self) -> NodeKind
pub fn range(&self) -> Range<usize> ⓘ
pub fn children(&self) -> &[SyntaxElement]
Sourcepub fn child_nodes(&self) -> impl Iterator<Item = &SyntaxNode>
pub fn child_nodes(&self) -> impl Iterator<Item = &SyntaxNode>
Borrow the direct child nodes in source order, excluding token leaves.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyntaxNode
impl RefUnwindSafe for SyntaxNode
impl Send for SyntaxNode
impl Sync for SyntaxNode
impl Unpin for SyntaxNode
impl UnsafeUnpin for SyntaxNode
impl UnwindSafe for SyntaxNode
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