pub enum TokenKind {
Show 87 variants
Error,
Newline,
Name,
Int,
Hex,
Octal,
Binary,
Text,
True,
False,
Assert,
Break,
Continue,
Contract,
Fn,
Const,
Else,
Idx,
If,
Match,
Impl,
Pragma,
For,
Pub,
Return,
Revert,
SelfType,
SelfValue,
Struct,
Enum,
Trait,
Type,
Unsafe,
While,
And,
As,
In,
Not,
Or,
Let,
Mut,
Use,
ParenOpen,
ParenClose,
BracketOpen,
BracketClose,
BraceOpen,
BraceClose,
Colon,
ColonColon,
Comma,
Hash,
Semi,
Plus,
Minus,
Star,
Slash,
Pipe,
Amper,
Lt,
LtLt,
Gt,
GtGt,
Eq,
Dot,
DotDot,
Percent,
EqEq,
NotEq,
LtEq,
GtEq,
Tilde,
Hat,
StarStar,
StarStarEq,
PlusEq,
MinusEq,
StarEq,
SlashEq,
PercentEq,
AmperEq,
PipeEq,
HatEq,
LtLtEq,
GtGtEq,
Arrow,
FatArrow,
}
Variants§
Error
Newline
Name
Int
Hex
Octal
Binary
Text
True
False
Assert
Break
Continue
Contract
Fn
Const
Else
Idx
If
Match
Impl
Pragma
For
Pub
Return
Revert
SelfType
SelfValue
Struct
Enum
Trait
Type
Unsafe
While
And
As
In
Not
Or
Let
Mut
Use
ParenOpen
ParenClose
BracketOpen
BracketClose
BraceOpen
BraceClose
Colon
ColonColon
Comma
Hash
Semi
Plus
Minus
Star
Slash
Pipe
Amper
Lt
LtLt
Gt
GtGt
Eq
Dot
DotDot
Percent
EqEq
NotEq
LtEq
GtEq
Tilde
Hat
StarStar
StarStarEq
PlusEq
MinusEq
StarEq
SlashEq
PercentEq
AmperEq
PipeEq
HatEq
LtLtEq
GtGtEq
Arrow
FatArrow
Implementations§
Trait Implementations§
Source§impl<'s> Logos<'s> for TokenKind
impl<'s> Logos<'s> for TokenKind
Source§type Extras = ()
type Extras = ()
Associated type
Extras
for the particular lexer. This can be set using
#[logos(extras = MyExtras)]
and accessed inside callbacks.Source§type Source = str
type Source = str
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]
.Source§fn lex(lex: &mut Lexer<'s, Self>)
fn lex(lex: &mut Lexer<'s, Self>)
The heart of Logos. Called by the
Lexer
. The implementation for this function
is generated by the logos-derive
crate.§fn lexer(source: &'source Self::Source) -> Lexer<'source, Self>where
Self::Extras: Default,
fn lexer(source: &'source Self::Source) -> Lexer<'source, Self>where
Self::Extras: Default,
Create a new instance of a
Lexer
that will produce tokens implementing
this Logos
.§fn lexer_with_extras(
source: &'source Self::Source,
extras: Self::Extras,
) -> Lexer<'source, Self>
fn lexer_with_extras( source: &'source Self::Source, extras: Self::Extras, ) -> Lexer<'source, Self>
Create a new instance of a
Lexer
with the provided Extras
that will
produce tokens implementing this Logos
.impl Copy for TokenKind
impl Eq for TokenKind
impl StructuralPartialEq for TokenKind
Auto Trait Implementations§
impl Freeze for TokenKind
impl RefUnwindSafe for TokenKind
impl Send for TokenKind
impl Sync for TokenKind
impl Unpin for TokenKind
impl UnwindSafe for TokenKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.