pub enum Kind {
Special = 0,
Int = 1,
UInt = 2,
Float = 3,
Sequence = 4,
Map = 5,
Symbol = 6,
Bytes = 7,
}
Expand description
The type of an atom.
Variants§
Special = 0
A value with a special meaning.
Int = 1
A signed integer. Argument is the byte length, minus one. The following bytes are the value, stored in little endian.
UInt = 2
An unsigned integer. Argument is the byte length, minus one. The following bytes are the value, stored in little endian.
Float = 3
A floating point value. Argument is the byte length, minus one. Must be
either 2, 4 or 8 bytes. The following bytes are the value, stored in
little endian. The two-byte representation follows the IEEE 754-2008
standard, implemented by the half
crate.
Sequence = 4
A list of atoms. Argument is the count of atoms in the sequence.
Map = 5
A list of key-value pairs. Argument is the count of entries in the map. There will be twice as many total atoms, since each entry is a key/value pair.
Symbol = 6
A symbol. If the least-significant bit of the arg is 0, this is a new symbol. The remaining bits of the arg contain the length in bytes. The following bytes will contain the symbol bytes (UTF-8). It should be stored and given a unique symbol id, starting at 0.
If the least-significant bit of the arg is 1, the remaining bits are the symbol id of a previously emitted symbol.
Bytes = 7
A series of bytes. The argument is the length. The bytes follow.