[−][src]Struct rowan::api::SyntaxNode
Implementations
impl<L: Language> SyntaxNode<L>
[src]
pub fn new_root(green: GreenNode) -> SyntaxNode<L>
[src]
pub fn replace_with(&self, replacement: GreenNode) -> GreenNode
[src]
Returns a green tree, equal to the green tree this node belongs two, except with this node substitute. The complexity of operation is proportional to the depth of the tree
pub fn kind(&self) -> L::Kind
[src]
pub fn text_range(&self) -> TextRange
[src]
pub fn text(&self) -> SyntaxText
[src]
pub fn green(&self) -> &GreenNode
[src]
pub fn parent(&self) -> Option<SyntaxNode<L>>
[src]
pub fn ancestors(&self) -> impl Iterator<Item = SyntaxNode<L>>
[src]
pub fn children(&self) -> SyntaxNodeChildren<L>ⓘNotable traits for SyntaxNodeChildren<L>
impl<L: Language> Iterator for SyntaxNodeChildren<L> type Item = SyntaxNode<L>;
[src]
Notable traits for SyntaxNodeChildren<L>
impl<L: Language> Iterator for SyntaxNodeChildren<L> type Item = SyntaxNode<L>;
pub fn children_with_tokens(&self) -> SyntaxElementChildren<L>ⓘNotable traits for SyntaxElementChildren<L>
impl<L: Language> Iterator for SyntaxElementChildren<L> type Item = SyntaxElement<L>;
[src]
Notable traits for SyntaxElementChildren<L>
impl<L: Language> Iterator for SyntaxElementChildren<L> type Item = SyntaxElement<L>;
pub fn first_child(&self) -> Option<SyntaxNode<L>>
[src]
pub fn first_child_or_token(&self) -> Option<SyntaxElement<L>>
[src]
pub fn last_child(&self) -> Option<SyntaxNode<L>>
[src]
pub fn last_child_or_token(&self) -> Option<SyntaxElement<L>>
[src]
pub fn next_sibling(&self) -> Option<SyntaxNode<L>>
[src]
pub fn next_sibling_or_token(&self) -> Option<SyntaxElement<L>>
[src]
pub fn prev_sibling(&self) -> Option<SyntaxNode<L>>
[src]
pub fn prev_sibling_or_token(&self) -> Option<SyntaxElement<L>>
[src]
pub fn first_token(&self) -> Option<SyntaxToken<L>>
[src]
Return the leftmost token in the subtree of this node.
pub fn last_token(&self) -> Option<SyntaxToken<L>>
[src]
Return the rightmost token in the subtree of this node.
pub fn siblings(
&self,
direction: Direction
) -> impl Iterator<Item = SyntaxNode<L>>
[src]
&self,
direction: Direction
) -> impl Iterator<Item = SyntaxNode<L>>
pub fn siblings_with_tokens(
&self,
direction: Direction
) -> impl Iterator<Item = SyntaxElement<L>>
[src]
&self,
direction: Direction
) -> impl Iterator<Item = SyntaxElement<L>>
pub fn descendants(&self) -> impl Iterator<Item = SyntaxNode<L>>
[src]
pub fn descendants_with_tokens(&self) -> impl Iterator<Item = SyntaxElement<L>>
[src]
pub fn preorder(&self) -> Preorder<L>ⓘ
[src]
Traverse the subtree rooted at the current node (including the current node) in preorder, excluding tokens.
pub fn preorder_with_tokens(
&self
) -> impl Iterator<Item = WalkEvent<SyntaxElement<L>>>
[src]
&self
) -> impl Iterator<Item = WalkEvent<SyntaxElement<L>>>
Traverse the subtree rooted at the current node (including the current node) in preorder, including tokens.
pub fn token_at_offset(&self, offset: TextSize) -> TokenAtOffset<SyntaxToken<L>>ⓘNotable traits for TokenAtOffset<T>
impl<T> Iterator for TokenAtOffset<T> type Item = T;
[src]
Notable traits for TokenAtOffset<T>
impl<T> Iterator for TokenAtOffset<T> type Item = T;
Find a token in the subtree corresponding to this node, which covers the offset. Precondition: offset must be withing node's range.
pub fn covering_element(&self, range: TextRange) -> SyntaxElement<L>
[src]
Return the deepest node or token in the current subtree that fully contains the range. If the range is empty and is contained in two leaf nodes, either one can be returned. Precondition: range must be contained withing the current node
pub fn child_or_token_at_range(
&self,
range: TextRange
) -> Option<SyntaxElement<L>>
[src]
&self,
range: TextRange
) -> Option<SyntaxElement<L>>
Trait Implementations
impl<L: Clone + Language> Clone for SyntaxNode<L>
[src]
fn clone(&self) -> SyntaxNode<L>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<L: Language> Debug for SyntaxNode<L>
[src]
impl<L: Language> Display for SyntaxNode<L>
[src]
impl<L: Eq + Language> Eq for SyntaxNode<L>
[src]
impl<L: Language> From<SyntaxNode<L>> for SyntaxElement<L>
[src]
fn from(node: SyntaxNode<L>) -> SyntaxElement<L>
[src]
impl<L: Language> From<SyntaxNode<L>> for SyntaxNode
[src]
fn from(node: SyntaxNode<L>) -> SyntaxNode
[src]
impl<L: Language> From<SyntaxNode> for SyntaxNode<L>
[src]
fn from(raw: SyntaxNode) -> SyntaxNode<L>
[src]
impl<L: Hash + Language> Hash for SyntaxNode<L>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<L: PartialEq + Language> PartialEq<SyntaxNode<L>> for SyntaxNode<L>
[src]
fn eq(&self, other: &SyntaxNode<L>) -> bool
[src]
fn ne(&self, other: &SyntaxNode<L>) -> bool
[src]
impl<L: Language> StructuralEq for SyntaxNode<L>
[src]
impl<L: Language> StructuralPartialEq for SyntaxNode<L>
[src]
Auto Trait Implementations
impl<L> !RefUnwindSafe for SyntaxNode<L>
impl<L> !Send for SyntaxNode<L>
impl<L> !Sync for SyntaxNode<L>
impl<L> Unpin for SyntaxNode<L> where
L: Unpin,
L: Unpin,
impl<L> !UnwindSafe for SyntaxNode<L>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,