Type Alias rowan::cursor::SyntaxElement
source · pub type SyntaxElement = NodeOrToken<SyntaxNode, SyntaxToken>;
Aliased Type§
enum SyntaxElement {
Node(SyntaxNode),
Token(SyntaxToken),
}
Variants§
Node(SyntaxNode)
Token(SyntaxToken)
Implementations§
source§impl SyntaxElement
impl SyntaxElement
pub fn text_range(&self) -> TextRange
pub fn index(&self) -> usize
pub fn kind(&self) -> SyntaxKind
pub fn parent(&self) -> Option<SyntaxNode>
pub fn ancestors(&self) -> impl Iterator<Item = SyntaxNode>
pub fn first_token(&self) -> Option<SyntaxToken>
pub fn last_token(&self) -> Option<SyntaxToken>
pub fn next_sibling_or_token(&self) -> Option<SyntaxElement>
pub fn prev_sibling_or_token(&self) -> Option<SyntaxElement>
pub fn detach(&self)
Trait Implementations§
source§impl<L: Language> From<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>> for SyntaxElement
impl<L: Language> From<NodeOrToken<SyntaxNode<L>, SyntaxToken<L>>> for SyntaxElement
source§fn from(element: SyntaxElement<L>) -> SyntaxElement
fn from(element: SyntaxElement<L>) -> SyntaxElement
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 From<SyntaxToken> for SyntaxElement
impl From<SyntaxToken> for SyntaxElement
source§fn from(token: SyntaxToken) -> SyntaxElement
fn from(token: SyntaxToken) -> SyntaxElement
Converts to this type from the input type.