Enum nachricht::Header[][src]

pub enum Header {
Show 13 variants Null, True, False, F32, F64, Bin(usize), Pos(u64), Neg(u64), Bag(usize), Str(usize), Sym(usize), Key(usize), Ref(usize),
}

Variants

Null

Also known as unit or nil

True

The boolean value true

False

The boolean value false

F32

The following four bytes contain an IEEE-754 32-bit floating point number

F64

The following eight bytes contain an IEEE-754 64-bit floating point number

Bin(usize)

Tuple Fields

0: usize

The value describes the length of a following byte array. Note that this code also contains the five fixed length values.

Pos(u64)

Tuple Fields

0: u64

The value describes a postive integer fitting into an u64

Neg(u64)

Tuple Fields

0: u64

The value describes a negative integer whose negative fits into an u64

Bag(usize)

Tuple Fields

0: usize

The value describes the length in fields of a container. the fields follow the header immediately.

Str(usize)

Tuple Fields

0: usize

The value describes the length in bytes of a following unicode string

Sym(usize)

Tuple Fields

0: usize

A symbol has the same semantics as a string except that it gets pushed into the symbol table and can be referenced from there

Key(usize)

Tuple Fields

0: usize

The value describes the length in bytes of a following key value. This in itself does not define a field and thus has to immediately followed by another header whose field will be named by this key.

Ref(usize)

Tuple Fields

0: usize

A reference into the symbol table. This could resolve to either a symbol (which itself resolve to a string) or a key.

Implementations

Returns the mnemonic of the header. This is useful for error messages.

Returns the number of written bytes

Returns the decoded header and the number of consumed bytes

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

Performs the conversion.

Performs the conversion.

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.