Enum taml::Token[][src]

pub enum Token<'a, Position> {
Show 23 variants Comment(&'a str), HeadingHashes(usize), Newline, Brac, Ket, Bra, Ce, Paren, Thesis, Comma, Period, String(Cow<'a, String, str>), InvalidStringWithVerbatimCarriageReturn(&'a str), DataLiteral(DataLiteral<'a, Position>), InvalidDataLiteralWithVerbatimCarriageReturn(InvalidDataLiteral<'a, Position>), Decimal(&'a str), InvalidZeroPrefixedDecimal(&'a str), Integer(&'a str), InvalidZeroPrefixedInteger(&'a str), Colon, Identifier(Cow<'a, String, str>), InvalidIdentifierWithVerbatimCarriageReturn(&'a str), Error,
}

Variants

Comment

Tuple Fields of Comment

0: &'a str
HeadingHashes

Tuple Fields of HeadingHashes

0: usize
Newline
Brac
Ket
Bra
Ce
Paren
Thesis
Comma
Period
String

Tuple Fields of String

0: Cow<'a, String, str>
InvalidStringWithVerbatimCarriageReturn

Unlike in Token::String, the quoted string is not unescaped in order to preserve the '\r' vs '\\r' distinction.

Tuple Fields of InvalidStringWithVerbatimCarriageReturn

0: &'a str
DataLiteral

Tuple Fields of DataLiteral

0: DataLiteral<'a, Position>
InvalidDataLiteralWithVerbatimCarriageReturn

Unlike in Token::DataLiteral, the strings are not unescaped in order to preserve the '\r' vs '\\r' distinction.

Tuple Fields of InvalidDataLiteralWithVerbatimCarriageReturn

0: InvalidDataLiteral<'a, Position>
Decimal

Tuple Fields of Decimal

0: &'a str
InvalidZeroPrefixedDecimal

Tuple Fields of InvalidZeroPrefixedDecimal

0: &'a str
Integer

Tuple Fields of Integer

0: &'a str
InvalidZeroPrefixedInteger

Tuple Fields of InvalidZeroPrefixedInteger

0: &'a str
Colon
Identifier

Tuple Fields of Identifier

0: Cow<'a, String, str>
InvalidIdentifierWithVerbatimCarriageReturn

Unlike in Token::Identifier, the quoted string is not unescaped in order to preserve the '\r' vs '\\r' distinction.

Tuple Fields of InvalidIdentifierWithVerbatimCarriageReturn

0: &'a str
Error

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Panics

This Display implementation panics when called on Token::Error.

It also panics when used on Invalid…WithCarriageReturn tokens that cannot be reparsed as such, for example by containing improper escape sequences.

Formats the value using the given formatter. Read more

Associated type Extras for the particular lexer. This can be set using #[logos(extras = MyExtras)] and accessed inside callbacks. Read more

Source type this token can be lexed from. This will default to str, unless one of the defined patterns explicitly uses non-unicode byte values or byte slices, in which case that implementation will use [u8]. Read more

Helper const of the variant marked as #[error].

The heart of Logos. Called by the Lexer. The implementation for this function is generated by the logos-derive crate. Read more

Create a new instance of a Lexer that will produce tokens implementing this Logos. Read more

Create a new instance of a Lexer with the provided Extras that will produce tokens implementing this Logos. Read more

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

Converts self into T using Into<T>. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

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

Converts the given value to a String. Read more

Attempts to convert self into T using TryInto<T>. 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.