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

The text of the token.

The type of the token (Whitespace or Word).

The location of the token in the source body of text.

Methods

impl<'text> Token<'text>
[src]

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'text> Copy for Token<'text>
[src]

impl<'text> Debug for Token<'text>
[src]

Formats the value using the given formatter.

impl<'text> PartialEq for Token<'text>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.