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 4 or 8 bytes. The following bytes are the value, stored in little endian.

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.

Implementations

Converts from a u8. Returns an error if kind is an invalid value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.