Enum minicbor::decode::Token [−][src]
pub enum Token<'b> {
}
Expand description
Representation of possible CBOR tokens.
Requires feature "half"
.
Variants
Tuple Fields of Bool
0: bool
Tuple Fields of U8
0: u8
Tuple Fields of U16
0: u16
Tuple Fields of U32
0: u32
Tuple Fields of U64
0: u64
Tuple Fields of I8
0: i8
Tuple Fields of I16
0: i16
Tuple Fields of I32
0: i32
Tuple Fields of I64
0: i64
Tuple Fields of F16
0: f32
Tuple Fields of F32
0: f32
Tuple Fields of F64
0: f64
Tuple Fields of String
0: &'b str
Tuple Fields of Array
0: u64
Tuple Fields of Map
0: u64
Tuple Fields of Tag
0: Tag
Tuple Fields of Simple
0: u8
Start of indefinite byte string.
Start of indefinite text string.
Start of indefinite array.
Start of indefinite map.
Trait Implementations
Pretty print a token.
Since we only show a single token we can not use diagnostic notation
as in the Display
impl of Tokenizer
. Instead, the following
syntax is used:
- Numeric values and booleans are displayed as in Rust. Floats are always shown in scientific notation.
- Text strings are displayed in double quotes.
- Byte strings are displayed in single quotes prefixed with
h
and hex-encoded, e.g.h'01 02 ef'
. - An array is displayed as
A[n]
wheren
denotes the number of elements. The followingn
tokens are elements of this array. - A map is displayed as
M[n]
wheren
denotes the number of pairs. The followingn
tokens are entries of this map. - Tags are displayed with
T(t)
wheret
is the tag number. - Simple values are displayed as
simple(n)
wheren
denotes the numeric value. - Indefinite items start with:
?B[
for byte strings,?S[
for text strings,?A[
for arrays,?M[
for maps, and end with]
when aToken::Break
is encountered. All tokens in between belong to the indefinite container.
Token::Null
is displayed asnull
andToken::Undefined
asundefined
.
Auto Trait Implementations
impl<'b> RefUnwindSafe for Token<'b>
impl<'b> UnwindSafe for Token<'b>
Blanket Implementations
Mutably borrows from an owned value. Read more