pub enum Message {
Short(MessageHeader, [u8; 3]),
Long(MessageHeader, [u8; 16]),
}Expand description
Represents a HID++2.0 message.
Variants§
Short(MessageHeader, [u8; 3])
Represents a short HID++2.0 message with 3 bytes of payload.
Long(MessageHeader, [u8; 16])
Represents a long HID++2.0 message with 16 bytes of payload.
Implementations§
Source§impl Message
impl Message
Sourcepub fn header(&self) -> MessageHeader
pub fn header(&self) -> MessageHeader
Extracts the header of the message.
Sourcepub fn extend_payload(&self) -> [u8; 16]
pub fn extend_payload(&self) -> [u8; 16]
Extracts the payload of the message and fits it into an array capable of containing the longest possible payload, filling the rest up with zeroes.
Trait Implementations§
Source§impl From<HidppMessage> for Message
impl From<HidppMessage> for Message
Source§fn from(msg: HidppMessage) -> Self
fn from(msg: HidppMessage) -> Self
Converts to this type from the input type.
Source§impl From<Message> for HidppMessage
impl From<Message> for HidppMessage
impl Copy for Message
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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