pub enum Token {
Show 63 variants
Comment,
BlockComment,
Ident,
String,
PackageName,
PackagePath,
ImportKeyword,
WithKeyword,
TypeKeyword,
TupleKeyword,
ListKeyword,
OptionKeyword,
ResultKeyword,
BorrowKeyword,
ResourceKeyword,
VariantKeyword,
RecordKeyword,
FlagsKeyword,
EnumKeyword,
FuncKeyword,
StaticKeyword,
ConstructorKeyword,
U8Keyword,
S8Keyword,
U16Keyword,
S16Keyword,
U32Keyword,
S32Keyword,
U64Keyword,
S64Keyword,
F32Keyword,
F64Keyword,
CharKeyword,
BoolKeyword,
StringKeyword,
InterfaceKeyword,
WorldKeyword,
ExportKeyword,
NewKeyword,
LetKeyword,
UseKeyword,
IncludeKeyword,
AsKeyword,
PackageKeyword,
TargetsKeyword,
Semicolon,
OpenBrace,
CloseBrace,
Colon,
Equals,
OpenParen,
CloseParen,
Arrow,
OpenAngle,
CloseAngle,
Underscore,
OpenBracket,
CloseBracket,
Dot,
Ellipsis,
Comma,
Slash,
At,
}
Expand description
Represents a WAC token.
Variants§
Comment
A comment.
BlockComment
A block comment.
Ident
An identifier.
String
A string literal.
PackageName
A package name.
PackagePath
A package path with optional semantic version.
ImportKeyword
The import
keyword.
WithKeyword
The with
keyword.
TypeKeyword
The type
keyword.
TupleKeyword
The tuple
keyword.
ListKeyword
The list
keyword.
OptionKeyword
The option
keyword.
ResultKeyword
The result
keyword.
BorrowKeyword
The borrow
keyword.
ResourceKeyword
The resource
keyword.
VariantKeyword
The variant
keyword.
RecordKeyword
The record
keyword.
FlagsKeyword
The flags
keyword.
EnumKeyword
The enum
keyword.
FuncKeyword
The func
keyword.
StaticKeyword
The static
keyword.
ConstructorKeyword
The constructor
keyword.
U8Keyword
The u8
keyword.
S8Keyword
The s8
keyword.
U16Keyword
The u16
keyword.
S16Keyword
The s16
keyword.
U32Keyword
The u32
keyword.
S32Keyword
The s32
keyword.
U64Keyword
The u64
keyword.
S64Keyword
The s64
keyword.
F32Keyword
The f32
keyword.
F64Keyword
The f64
keyword.
CharKeyword
The char
keyword.
BoolKeyword
The bool
keyword.
StringKeyword
The string
keyword.
InterfaceKeyword
The interface
keyword.
WorldKeyword
The world
keyword.
ExportKeyword
The export
keyword.
NewKeyword
The new
keyword.
LetKeyword
The let
keyword.
UseKeyword
The use
keyword.
IncludeKeyword
The include
keyword.
AsKeyword
The as
keyword.
PackageKeyword
The package
keyword.
TargetsKeyword
The targets
keyword.
Semicolon
The ;
symbol.
OpenBrace
The {
symbol.
CloseBrace
The }
symbol.
Colon
The :
symbol.
Equals
The =
symbol.
OpenParen
The (
symbol.
CloseParen
The )
symbol.
Arrow
The ->
symbol.
OpenAngle
The <
symbol.
CloseAngle
The >
symbol.
Underscore
The _
symbol.
OpenBracket
The [
symbol.
CloseBracket
The ]
symbol.
Dot
The .
symbol.
Ellipsis
The ...
symbol.
Comma
The ,
symbol.
Slash
The /
symbol.
At
The @
symbol.
Trait Implementations§
Source§impl<'s> Logos<'s> for Token
impl<'s> Logos<'s> for Token
Source§type Error = Error
type Error = Error
#[logos(error = MyError)]
. Defaults to ()
if not set.Source§type Extras = ()
type Extras = ()
Extras
for the particular lexer. This can be set using
#[logos(extras = MyExtras)]
and accessed inside callbacks.Source§type Source = str
type Source = str
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>)
Lexer
. The implementation for this function
is generated by the logos-derive
crate.impl Copy for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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
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§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
key
and return true
if they are equal.