pub enum Token<'a> {
Show 72 variants
ILLEGAL(&'a str),
EOF,
IDENT(&'a str, Option<SocketPlug>),
VALUE(Value<'a>),
TAG(Option<u8>, Option<TagConstraint<'a>>),
ASSIGN,
OPTIONAL,
ASTERISK,
ONEORMORE,
UNWRAP,
COMMA,
COLON,
COMMENT(&'a str),
TCHOICE,
GCHOICE,
TCHOICEALT,
GCHOICEALT,
ARROWMAP,
CUT,
RANGEOP(bool),
RANGE(RangeValue<'a>, RangeValue<'a>, bool),
LPAREN,
RPAREN,
LBRACE,
RBRACE,
LBRACKET,
RBRACKET,
LANGLEBRACKET,
RANGLEBRACKET,
ControlOperator(ControlOperator),
GTOCHOICE,
FALSE,
TRUE,
BOOL,
NIL,
NULL,
UINT,
NINT,
INT,
FLOAT16,
FLOAT32,
FLOAT64,
FLOAT1632,
FLOAT3264,
FLOAT,
BSTR,
TSTR,
ANY,
BYTES,
TEXT,
TDATE,
TIME,
NUMBER,
BIGUINT,
BIGNINT,
BIGINT,
INTEGER,
UNSIGNED,
DECFRAC,
BIGFLOAT,
EB64URL,
EB64LEGACY,
EB16,
ENCODEDCBOR,
URI,
B64URL,
B64LEGACY,
REGEXP,
MIMEMESSAGE,
CBORANY,
UNDEFINED,
NEWLINE,
}Expand description
Token which represents a valid CDDL character or sequence
Variants§
ILLEGAL(&'a str)
Illegal sequence of characters
EOF
End of file
IDENT(&'a str, Option<SocketPlug>)
Identifier
VALUE(Value<'a>)
Value
TAG(Option<u8>, Option<TagConstraint<'a>>)
CBOR tag ‘#’
Tuple Fields
1: Option<TagConstraint<'a>>Optional constraint - either a literal number or a type expression
ASSIGN
Assignment operator ‘=’
OPTIONAL
Optional occurrence indicator ‘?’
ASTERISK
Zero or more occurrence indicator ‘*’
ONEORMORE
One or more occurrence indicator ‘+’
UNWRAP
Unwrap operator ‘~’
COMMA
Comma ‘,’
COLON
Colon ‘:’
COMMENT(&'a str)
Comment text
TCHOICE
Type choice indicator ‘/’
GCHOICE
Group choice indicator ‘//’
TCHOICEALT
Type choice alternative ‘/=’
GCHOICEALT
Group choice alternative ‘//=’
ARROWMAP
Arrow map ‘=>’
CUT
Cut ‘^’
RANGEOP(bool)
Range operator. Inclusive ‘..’ if true, otherwise exclusive ’…’s
RANGE(RangeValue<'a>, RangeValue<'a>, bool)
Range
LPAREN
Left opening parend
RPAREN
Right closing parend
LBRACE
Left opening brace
RBRACE
Right closing brace
LBRACKET
Left opening bracket
RBRACKET
Right closing bracket
LANGLEBRACKET
Left opening angle bracket
RANGLEBRACKET
Right closing angle bracket
ControlOperator(ControlOperator)
Control operator token
GTOCHOICE
group to choice enumeration ‘&’
FALSE
false
TRUE
true
BOOL
bool
NIL
nil
NULL
null
UINT
uint
NINT
nint
INT
int
FLOAT16
float16
FLOAT32
float32
FLOAT64
float64
FLOAT1632
float16-32
FLOAT3264
float32-64
FLOAT
float
BSTR
bstr
TSTR
tstr
ANY
any
BYTES
bytes
TEXT
text
TDATE
tdate
TIME
time
NUMBER
number
BIGUINT
biguint
BIGNINT
bignint
BIGINT
bigint
INTEGER
integer
UNSIGNED
unsigned
DECFRAC
decfrac
BIGFLOAT
bigfloat
EB64URL
eb64url
EB64LEGACY
eb64legacy
EB16
eb16k
ENCODEDCBOR
encoded-cbor
URI
uri
B64URL
b64url
B64LEGACY
b64legacy
REGEXP
regexp
MIMEMESSAGE
mime-message
CBORANY
cbor-any
UNDEFINED
undefined
NEWLINE
newline (used only for comment formatting when compiled with the “lsp” feature)
Implementations§
Trait Implementations§
Source§impl<'a> From<Token<'a>> for Identifier<'a>
impl<'a> From<Token<'a>> for Identifier<'a>
Source§impl<'a> TryFrom<Token<'a>> for RangeValue<'a>
impl<'a> TryFrom<Token<'a>> for RangeValue<'a>
impl<'a> StructuralPartialEq for Token<'a>
Auto Trait Implementations§
impl<'a> Freeze for Token<'a>
impl<'a> RefUnwindSafe for Token<'a>
impl<'a> Send for Token<'a>
impl<'a> Sync for Token<'a>
impl<'a> Unpin for Token<'a>
impl<'a> UnwindSafe for Token<'a>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more