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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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 for RawMessage
impl PartialEq for RawMessage
impl Eq for RawMessage
impl StructuralPartialEq for RawMessage
Auto Trait Implementations§
impl Freeze for RawMessage
impl RefUnwindSafe for RawMessage
impl Send for RawMessage
impl Sync for RawMessage
impl Unpin for RawMessage
impl UnwindSafe for RawMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more