Struct lifx_core::RawMessage
source · 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: Frame
§frame_addr: FrameAddress
§protocol_header: ProtocolHeader
§payload: Vec<u8>
Implementations§
source§impl RawMessage
impl RawMessage
sourcepub fn build(options: &BuildOptions, typ: Message) -> Result<RawMessage, Error>
pub fn build(options: &BuildOptions, typ: Message) -> Result<RawMessage, Error>
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)
sourcepub fn packed_size(&self) -> usize
pub fn packed_size(&self) -> usize
The total size (in bytes) of the packed version of this message.
Trait Implementations§
source§impl Clone for RawMessage
impl Clone for RawMessage
source§fn clone(&self) -> RawMessage
fn clone(&self) -> RawMessage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RawMessage
impl Debug for RawMessage
source§impl PartialEq<RawMessage> for RawMessage
impl PartialEq<RawMessage> for RawMessage
source§fn eq(&self, other: &RawMessage) -> bool
fn eq(&self, other: &RawMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.