pub struct RawMessage {
    pub frame: Frame,
    pub frame_addr: FrameAddress,
    pub protocol_header: ProtocolHeader,
    pub payload: Vec<u8>,
}
Expand description

The raw message structure

Contains a low-level protocol info. This is what is sent and received via UDP packets.

To parse the payload, use Message::from_raw.

Fields

frame: Frameframe_addr: FrameAddressprotocol_header: ProtocolHeaderpayload: Vec<u8>

Implementations

Build a RawMessage (which is suitable for sending on the network) from a given Message type.

If BuildOptions::target is None, then the message is addressed to all devices. Else it should be a bulb UID (MAC address)

The total size (in bytes) of the packed version of this message.

Validates that this object was constructed correctly. Panics if not.

Packs this RawMessage into some bytes that can be send over the network.

The length of the returned data will be RawMessage::packed_size in size.

Given some bytes (generally read from a network socket), unpack the data into a RawMessage structure.

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.