pub enum ElementType {
SignedInt(Width),
UnsignedInt(Width),
Bool(bool),
Float,
Double,
Utf8(Width),
Octets(Width),
Null,
Structure,
Array,
List,
EndOfContainer,
}Expand description
The element type field: the low 5 bits of a control octet (Core §A.7.1).
The variants carry the width the specification packs into the bottom two bits, because a reader needs it and a writer chooses it.
Variants§
SignedInt(Width)
Signed integer; the value field is 1, 2, 4 or 8 octets.
UnsignedInt(Width)
Unsigned integer; the value field is 1, 2, 4 or 8 octets.
Bool(bool)
Boolean; the value is in the control octet itself.
Float
Single-precision float, 4-octet value.
Double
Double-precision float, 8-octet value.
Utf8(Width)
UTF-8 string; the length field is 1, 2, 4 or 8 octets.
Octets(Width)
Octet string; the length field is 1, 2, 4 or 8 octets.
Null
The null value.
Structure
Structure: members are uniquely tagged and never anonymous (§A.5.1).
Array
Array: members are always anonymous (§A.5.2).
List
List: members may carry any tag form, including none (§A.5.3).
EndOfContainer
End-of-container, control octet 0x18 exactly (§A.10).