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
Tuple Fields of Comment
0: &'a str
Tuple Fields of HeadingHashes
0: usize
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
Tuple Fields of DataLiteral
0: DataLiteral<'a, Position>
Unlike in Token::DataLiteral
, the strings are not unescaped in order to preserve the '\r'
vs '\\r'
distinction.
Tuple Fields of Decimal
0: &'a str
Tuple Fields of InvalidZeroPrefixedDecimal
0: &'a str
Tuple Fields of Integer
0: &'a str
Tuple Fields of InvalidZeroPrefixedInteger
0: &'a str
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
Trait Implementations
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.
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
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
Auto Trait Implementations
impl<'a, Position> RefUnwindSafe for Token<'a, Position> where
Position: RefUnwindSafe,
impl<'a, Position> UnwindSafe for Token<'a, Position> where
Position: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
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.
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