pub enum Kind {
Special,
Int,
UInt,
Float,
Sequence,
Map,
Symbol,
Bytes,
}
Expand description
The type of an atom.
Variants§
Special
A value with a special meaning.
Int
A signed integer. Argument is the byte length, minus one. The following bytes are the value, stored in little endian.
UInt
An unsigned integer. Argument is the byte length, minus one. The following bytes are the value, stored in little endian.
Float
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
A list of atoms. Argument is the count of atoms in the sequence.
Map
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
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
A series of bytes. The argument is the length. The bytes follow.