Struct aversion::util::TinyHeader[][src]

pub struct TinyHeader {
    pub msg_id: u16,
    pub msg_ver: u16,
}
Expand description

A header that can be serialized into a fixed-size buffer.

This header does not use serde; it serializes to a binary (big-endian) array of 4 bytes.

Fields

msg_id: u16

The message id.

msg_ver: u16

The message version.

Implementations

Create a new TinyHeader

Create a new TinyHeader that corresponds to a type.

The version and message id values will be filled in from the type’s Versioned and MessageId associated constants.

Deserialize a header from a Read stream.

Deserialize a header from a 4-byte slice.

Serialize a header into a Write stream.

Serialize a header into a 4-byte array.

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

Retrieve the message id.

Retrieve the message version.

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)

recently added

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.