Struct rowan::cursor::SyntaxNode
source · pub struct SyntaxNode { /* private fields */ }
Implementations§
source§impl SyntaxNode
impl SyntaxNode
pub fn new_root(green: GreenNode) -> SyntaxNode
pub fn new_root_mut(green: GreenNode) -> SyntaxNode
pub fn is_mutable(&self) -> bool
pub fn clone_for_update(&self) -> SyntaxNode
pub fn clone_subtree(&self) -> SyntaxNode
pub fn replace_with(&self, replacement: GreenNode) -> GreenNode
pub fn kind(&self) -> SyntaxKind
pub fn text_range(&self) -> TextRange
pub fn index(&self) -> usize
pub fn text(&self) -> SyntaxText
pub fn green(&self) -> Cow<'_, GreenNodeData>
pub fn parent(&self) -> Option<SyntaxNode>
pub fn ancestors(&self) -> impl Iterator<Item = SyntaxNode>
pub fn children(&self) -> SyntaxNodeChildren ⓘ
pub fn children_with_tokens(&self) -> SyntaxElementChildren ⓘ
pub fn first_child(&self) -> Option<SyntaxNode>
pub fn last_child(&self) -> Option<SyntaxNode>
pub fn first_child_or_token(&self) -> Option<SyntaxElement>
pub fn last_child_or_token(&self) -> Option<SyntaxElement>
pub fn next_sibling(&self) -> Option<SyntaxNode>
pub fn prev_sibling(&self) -> Option<SyntaxNode>
pub fn next_sibling_or_token(&self) -> Option<SyntaxElement>
pub fn prev_sibling_or_token(&self) -> Option<SyntaxElement>
pub fn first_token(&self) -> Option<SyntaxToken>
pub fn last_token(&self) -> Option<SyntaxToken>
pub fn siblings(&self, direction: Direction) -> impl Iterator<Item = SyntaxNode>
pub fn siblings_with_tokens( &self, direction: Direction, ) -> impl Iterator<Item = SyntaxElement>
pub fn descendants(&self) -> impl Iterator<Item = SyntaxNode>
pub fn descendants_with_tokens(&self) -> impl Iterator<Item = SyntaxElement>
pub fn preorder(&self) -> Preorder ⓘ
pub fn preorder_with_tokens(&self) -> PreorderWithTokens ⓘ
pub fn token_at_offset(&self, offset: TextSize) -> TokenAtOffset<SyntaxToken> ⓘ
pub fn covering_element(&self, range: TextRange) -> SyntaxElement
pub fn child_or_token_at_range(&self, range: TextRange) -> Option<SyntaxElement>
pub fn splice_children( &self, to_delete: Range<usize>, to_insert: Vec<SyntaxElement>, )
pub fn detach(&self)
Trait Implementations§
source§impl Clone for SyntaxNode
impl Clone for SyntaxNode
source§impl Debug for SyntaxNode
impl Debug for SyntaxNode
source§impl Display for SyntaxNode
impl Display for SyntaxNode
source§impl Drop for SyntaxNode
impl Drop for SyntaxNode
source§impl<L: Language> From<SyntaxNode<L>> for SyntaxNode
impl<L: Language> From<SyntaxNode<L>> for SyntaxNode
source§fn from(node: SyntaxNode<L>) -> SyntaxNode
fn from(node: SyntaxNode<L>) -> SyntaxNode
Converts to this type from the input type.
source§impl From<SyntaxNode> for SyntaxElement
impl From<SyntaxNode> for SyntaxElement
source§fn from(node: SyntaxNode) -> SyntaxElement
fn from(node: SyntaxNode) -> SyntaxElement
Converts to this type from the input type.
source§impl<L: Language> From<SyntaxNode> for SyntaxNode<L>
impl<L: Language> From<SyntaxNode> for SyntaxNode<L>
source§fn from(raw: SyntaxNode) -> SyntaxNode<L>
fn from(raw: SyntaxNode) -> SyntaxNode<L>
Converts to this type from the input type.
source§impl Hash for SyntaxNode
impl Hash for SyntaxNode
source§impl PartialEq for SyntaxNode
impl PartialEq for SyntaxNode
impl Eq for SyntaxNode
Auto Trait Implementations§
impl Freeze for SyntaxNode
impl !RefUnwindSafe for SyntaxNode
impl !Send for SyntaxNode
impl !Sync for SyntaxNode
impl Unpin 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)