pub struct SyntaxToken(/* private fields */);Expand description
An opaque leaf token of the CST, carrying verbatim source text (incl. trivia).
Wraps rowan::SyntaxToken<RonLang>; the inner rowan type is never exposed.
Implementations§
Source§impl SyntaxToken
impl SyntaxToken
Sourcepub fn kind(&self) -> SyntaxKind
pub fn kind(&self) -> SyntaxKind
This token’s classification.
Sourcepub fn text_range(&self) -> TextRange
pub fn text_range(&self) -> TextRange
Absolute byte range spanned by this token.
Sourcepub fn text(&self) -> &str
pub fn text(&self) -> &str
The verbatim source slice for this token (never normalized or re-escaped).
Sourcepub fn parent(&self) -> Option<SyntaxNode>
pub fn parent(&self) -> Option<SyntaxNode>
Parent node.
Trait Implementations§
Source§impl Clone for SyntaxToken
impl Clone for SyntaxToken
Source§fn clone(&self) -> SyntaxToken
fn clone(&self) -> SyntaxToken
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SyntaxToken
impl Debug for SyntaxToken
impl Eq for SyntaxToken
Source§impl Hash for SyntaxToken
impl Hash for SyntaxToken
Source§impl PartialEq for SyntaxToken
impl PartialEq for SyntaxToken
impl StructuralPartialEq for SyntaxToken
Auto Trait Implementations§
impl !RefUnwindSafe for SyntaxToken
impl !Send for SyntaxToken
impl !Sync for SyntaxToken
impl !UnwindSafe for SyntaxToken
impl Freeze for SyntaxToken
impl Unpin for SyntaxToken
impl UnsafeUnpin for SyntaxToken
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