pub struct SyntaxNode(/* private fields */);Expand description
A snapshot-scoped lossless syntax node.
Implementations§
Source§impl SyntaxNode
impl SyntaxNode
Sourcepub fn kind(&self) -> SyntaxKind
pub fn kind(&self) -> SyntaxKind
Returns this node’s grammar category.
Sourcepub fn children(&self) -> impl Iterator<Item = Self> + '_
pub fn children(&self) -> impl Iterator<Item = Self> + '_
Iterates direct child nodes, excluding tokens.
Sourcepub fn children_with_tokens(&self) -> impl Iterator<Item = SyntaxElement> + '_
pub fn children_with_tokens(&self) -> impl Iterator<Item = SyntaxElement> + '_
Iterates direct child nodes and tokens in source order.
Trait Implementations§
Source§impl Clone for SyntaxNode
impl Clone for SyntaxNode
Auto Trait Implementations§
impl !RefUnwindSafe for SyntaxNode
impl !Send for SyntaxNode
impl !Sync for SyntaxNode
impl !UnwindSafe for SyntaxNode
impl Freeze for SyntaxNode
impl Unpin for SyntaxNode
impl UnsafeUnpin 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