pub struct Token {
pub start: Position,
pub spaces_before: SmolStr,
pub token_type: TokenType,
pub spaces_after: SmolStr,
pub end: Position,
}Expand description
A single token. Every lexable item becomes
a token in Lexer::next_token().
Fields§
§start: PositionThe starting position of this token
spaces_before: SmolStrThe spaces before the token.
token_type: TokenTypeThe actual info of the token.
spaces_after: SmolStrThe spaces after the token.
end: PositionThe ending position of this token.
Implementations§
Trait Implementations§
Source§impl GetRange for Token
impl GetRange for Token
Source§fn get_range(&self) -> Result<Range, GetRangeError>
fn get_range(&self) -> Result<Range, GetRangeError>
Get the range of the node. This will only fail if
Cst.status is
AstStatus::HasErrors.Source§impl Ord for Token
impl Ord for Token
Source§impl PartialOrd for Token
impl PartialOrd for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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