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
sourceimpl 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
sourceimpl Clone for RawMessage
impl Clone for RawMessage
sourcefn clone(&self) -> RawMessage
fn clone(&self) -> RawMessage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RawMessage
impl Debug for RawMessage
sourceimpl PartialEq<RawMessage> for RawMessage
impl PartialEq<RawMessage> for RawMessage
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &RawMessage) -> bool
fn ne(&self, other: &RawMessage) -> bool
This method tests for !=
.
impl Eq for RawMessage
impl StructuralEq for RawMessage
impl StructuralPartialEq for RawMessage
Auto Trait Implementations
impl RefUnwindSafe for RawMessage
impl Send for RawMessage
impl Sync for RawMessage
impl Unpin for RawMessage
impl UnwindSafe for RawMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more