luaur_common/records/
event.rs1use crate::enums::event_type::EventType;
2
3#[derive(Debug, Clone, Copy)]
4#[repr(C)]
5pub struct Event {
6 pub(crate) r#type: EventType,
7 pub(crate) token: u16,
8 pub(crate) data: EventData,
9}
10
11#[derive(Clone, Copy)]
12#[repr(C)]
13pub union EventData {
14 pub(crate) microsec: u32,
15 pub(crate) dataPos: u32,
16}
17
18impl std::fmt::Debug for EventData {
19 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20 f.debug_struct("EventData")
21 .field("microsec/dataPos", unsafe { &self.microsec })
22 .finish()
23 }
24}