Struct parce::lexer::Lexeme[][src]

pub struct Lexeme<T: Copy + Eq + Debug> {
    pub data: T,
    pub start: usize,
    pub len: usize,
}
Expand description

Wrapper for the lexeme enum, containing extra information about the location and length of the lexeme in the string input.

Fields

data: T

The lexeme matched in the input. The Lexeme struct is Shrinkwrapped around this field.

start: usize

The index in the input string where the lexeme starts.

len: usize

The number characters the lexeme uses in the input.

Trait Implementations

Performs the conversion.

Immutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

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

This method tests for !=.

Can only implement Lexeme == T, because trying to implement T == Lexeme violates orphan rules. When comparing a wrapped Lexeme to its internal type, put the lexeme first.

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.