pub struct EventContainer {
pub code: EventCode,
pub transaction_id: u32,
pub params: [u32; 3],
}Expand description
Event container from the device.
Fields§
§code: EventCodeEvent code identifying the event type.
transaction_id: u32Transaction ID (may be 0 for unsolicited events).
params: [u32; 3]Event parameters (always exactly 3).
Implementations§
Source§impl EventContainer
impl EventContainer
Sourcepub fn from_bytes(buf: &[u8]) -> Result<Self, Error>
pub fn from_bytes(buf: &[u8]) -> Result<Self, Error>
Parse an event container from bytes.
Events can have 0-3 parameters, so valid sizes are 12-24 bytes (header + 0-3 u32 params). Missing parameters default to 0.
Trait Implementations§
Source§impl Clone for EventContainer
impl Clone for EventContainer
Source§fn clone(&self) -> EventContainer
fn clone(&self) -> EventContainer
Returns a duplicate 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 EventContainer
impl Debug for EventContainer
Source§impl PartialEq for EventContainer
impl PartialEq for EventContainer
impl Eq for EventContainer
impl StructuralPartialEq for EventContainer
Auto Trait Implementations§
impl Freeze for EventContainer
impl RefUnwindSafe for EventContainer
impl Send for EventContainer
impl Sync for EventContainer
impl Unpin for EventContainer
impl UnsafeUnpin for EventContainer
impl UnwindSafe for EventContainer
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