pub enum EventRef<'a> {
Show 13 variants
Synchronize(&'a SynchronizeEvent),
Key(&'a KeyEvent),
Relative(&'a RelativeEvent),
Absolute(&'a AbsoluteEvent),
Switch(&'a SwitchEvent),
Misc(&'a MiscEvent),
Led(&'a LedEvent),
Autorepeat(&'a AutorepeatEvent),
Sound(&'a SoundEvent),
ForceFeedback(&'a ForceFeedbackEvent),
ForceFeedbackStatus(&'a ForceFeedbackStatusEvent),
UInput(&'a UInputEvent),
Unknown(&'a InputEvent),
}
Expand description
A reference to an input event.
Variants§
Synchronize(&'a SynchronizeEvent)
Key(&'a KeyEvent)
Relative(&'a RelativeEvent)
Absolute(&'a AbsoluteEvent)
Switch(&'a SwitchEvent)
Misc(&'a MiscEvent)
Led(&'a LedEvent)
Autorepeat(&'a AutorepeatEvent)
Sound(&'a SoundEvent)
ForceFeedback(&'a ForceFeedbackEvent)
ForceFeedbackStatus(&'a ForceFeedbackStatusEvent)
UInput(&'a UInputEvent)
Unknown(&'a InputEvent)
Unknown event type.
Implementations§
Source§impl<'a> EventRef<'a>
impl<'a> EventRef<'a>
Sourcepub fn new(event: &'a InputEvent) -> Result<Self, RangeError>
pub fn new(event: &'a InputEvent) -> Result<Self, RangeError>
Wraps the generic InputEvent
into an event.
Sourcepub fn as_event(self) -> &'a InputEvent
pub fn as_event(self) -> &'a InputEvent
Borrows the referenced event.
Trait Implementations§
Source§impl<'a> AsRef<InputEvent> for EventRef<'a>
impl<'a> AsRef<InputEvent> for EventRef<'a>
Source§fn as_ref(&self) -> &InputEvent
fn as_ref(&self) -> &InputEvent
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'a> From<&'a AbsoluteEvent> for EventRef<'a>
impl<'a> From<&'a AbsoluteEvent> for EventRef<'a>
Source§fn from(event: &'a AbsoluteEvent) -> Self
fn from(event: &'a AbsoluteEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a AutorepeatEvent> for EventRef<'a>
impl<'a> From<&'a AutorepeatEvent> for EventRef<'a>
Source§fn from(event: &'a AutorepeatEvent) -> Self
fn from(event: &'a AutorepeatEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a ForceFeedbackEvent> for EventRef<'a>
impl<'a> From<&'a ForceFeedbackEvent> for EventRef<'a>
Source§fn from(event: &'a ForceFeedbackEvent) -> Self
fn from(event: &'a ForceFeedbackEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a ForceFeedbackStatusEvent> for EventRef<'a>
impl<'a> From<&'a ForceFeedbackStatusEvent> for EventRef<'a>
Source§fn from(event: &'a ForceFeedbackStatusEvent) -> Self
fn from(event: &'a ForceFeedbackStatusEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a RelativeEvent> for EventRef<'a>
impl<'a> From<&'a RelativeEvent> for EventRef<'a>
Source§fn from(event: &'a RelativeEvent) -> Self
fn from(event: &'a RelativeEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a SoundEvent> for EventRef<'a>
impl<'a> From<&'a SoundEvent> for EventRef<'a>
Source§fn from(event: &'a SoundEvent) -> Self
fn from(event: &'a SoundEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a SwitchEvent> for EventRef<'a>
impl<'a> From<&'a SwitchEvent> for EventRef<'a>
Source§fn from(event: &'a SwitchEvent) -> Self
fn from(event: &'a SwitchEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a SynchronizeEvent> for EventRef<'a>
impl<'a> From<&'a SynchronizeEvent> for EventRef<'a>
Source§fn from(event: &'a SynchronizeEvent) -> Self
fn from(event: &'a SynchronizeEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a UInputEvent> for EventRef<'a>
impl<'a> From<&'a UInputEvent> for EventRef<'a>
Source§fn from(event: &'a UInputEvent) -> Self
fn from(event: &'a UInputEvent) -> Self
Converts to this type from the input type.
Source§impl<'a> From<EventRef<'a>> for &'a InputEvent
impl<'a> From<EventRef<'a>> for &'a InputEvent
Source§impl<'a> Ord for EventRef<'a>
impl<'a> Ord for EventRef<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialOrd for EventRef<'a>
impl<'a> PartialOrd for EventRef<'a>
impl<'a> Copy for EventRef<'a>
impl<'a> Eq for EventRef<'a>
impl<'a> StructuralPartialEq for EventRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for EventRef<'a>
impl<'a> RefUnwindSafe for EventRef<'a>
impl<'a> Send for EventRef<'a>
impl<'a> Sync for EventRef<'a>
impl<'a> Unpin for EventRef<'a>
impl<'a> UnwindSafe for EventRef<'a>
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