[−][src]Struct rowan::SyntaxToken
A token (leaf node) in a syntax tree.
A token can't exist in isolation, it is always attached to a parent Node.
Methods
impl<'a> SyntaxToken<'a>
[src]
pub fn kind(&self) -> SyntaxKind
[src]
Kind of this token.
pub fn text(&self) -> &'a SmolStr
[src]
Text of this token.
pub fn range(&self) -> TextRange
[src]
Text range, covered by this token.
pub fn parent(&self) -> &'a SyntaxNode
[src]
Parent node, containing this token.
pub fn next_sibling_or_token(&self) -> Option<SyntaxElement<'a>>
[src]
Next sibling of this tokens, including both nodes and tokens.
pub fn prev_sibling_or_token(&self) -> Option<SyntaxElement<'a>>
[src]
Previous sibling of this tokens, including both nodes and tokens.
pub fn next_token(&self) -> Option<SyntaxToken<'a>>
[src]
Next token in the file (i.e, not necessary a sibling)
pub fn prev_token(&self) -> Option<SyntaxToken<'a>>
[src]
Previous token in the file (i.e, not necessary a sibling)
pub fn replace_with(&self, replacement: GreenToken) -> GreenNode
[src]
Returns a green tree, equal to the green tree this token belongs two, except with this token substitute. The complexity of operation is proportional to the depth of the tree
Trait Implementations
impl<'a> Copy for SyntaxToken<'a>
[src]
impl<'a> From<SyntaxToken<'a>> for SyntaxElement<'a>
[src]
fn from(token: SyntaxToken<'a>) -> SyntaxElement<'a>
[src]
impl<'a> PartialEq<SyntaxToken<'a>> for SyntaxToken<'a>
[src]
fn eq(&self, other: &SyntaxToken<'a>) -> bool
[src]
fn ne(&self, other: &SyntaxToken<'a>) -> bool
[src]
impl<'a> Clone for SyntaxToken<'a>
[src]
fn clone(&self) -> SyntaxToken<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> Eq for SyntaxToken<'a>
[src]
impl<'a> Display for SyntaxToken<'a>
[src]
impl<'a> Debug for SyntaxToken<'a>
[src]
impl<'a> Hash for SyntaxToken<'a>
[src]
Auto Trait Implementations
impl<'a> Send for SyntaxToken<'a>
impl<'a> Sync for SyntaxToken<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,