Struct commands::tokenizer::Token
[−]
[src]
pub struct Token<'text> { pub text: &'text str, pub token_type: TokenType, pub location: SourceLocation, }
A token from a body of text.
The lifetime parameter 'text
refers to the lifetime
of the body of text that was tokenized, creating this token.
Fields
text: &'text str
The text of the token.
token_type: TokenType
The type of the token (Whitespace
or Word
).
location: SourceLocation
The location of the token in the source body of text.
Methods
impl<'text> Token<'text>
[src]
fn new(
text: &'text str,
token_type: TokenType,
location: SourceLocation
) -> Token
text: &'text str,
token_type: TokenType,
location: SourceLocation
) -> Token
Construct a Token
. The lifetime parameter 'text
refers
to the lifetime of the text being tokenized.
Trait Implementations
impl<'text> Clone for Token<'text>
[src]
fn clone(&self) -> Token<'text>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more