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