Enum input_linux::EventRef
source · 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> PartialEq for EventRef<'a>
impl<'a> PartialEq for EventRef<'a>
source§impl<'a> PartialOrd for EventRef<'a>
impl<'a> PartialOrd for EventRef<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<'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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)