Struct input_linux::MiscEvent
source · #[repr(C)]pub struct MiscEvent {
pub time: EventTime,
pub kind: MiscKind,
pub value: i32,
/* private fields */
}Expand description
Miscellaneous events.
Fields§
§time: EventTimeThe timestamp associated with the event.
kind: MiscKindThe kind of miscellaneous event.
value: i32The state/value of the event.
Implementations§
source§impl<'a> MiscEvent
impl<'a> MiscEvent
sourcepub const fn new(time: EventTime, kind: MiscKind, value: i32) -> Self
pub const fn new(time: EventTime, kind: MiscKind, value: i32) -> Self
Creates a new event from the given code and value.
sourcepub unsafe fn from_event<E: AsRef<input_event>>(event: &E) -> &Self
pub unsafe fn from_event<E: AsRef<input_event>>(event: &E) -> &Self
Reinterpret a generic event without checking for validity.
sourcepub unsafe fn from_event_mut(event: &mut InputEvent) -> &mut Self
pub unsafe fn from_event_mut(event: &mut InputEvent) -> &mut Self
Reinterpret a mutable generic event without checking for validity.
sourcepub fn into_event(self) -> InputEvent
pub fn into_event(self) -> InputEvent
A generic input event.
sourcepub fn as_event(&self) -> &InputEvent
pub fn as_event(&self) -> &InputEvent
A generic input event reference.
sourcepub unsafe fn as_event_mut(&mut self) -> &mut InputEvent
pub unsafe fn as_event_mut(&mut self) -> &mut InputEvent
A mutable generic input event reference.
Trait Implementations§
source§impl AsRef<InputEvent> for MiscEvent
impl AsRef<InputEvent> for MiscEvent
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 AsRef<input_event> for MiscEvent
impl AsRef<input_event> for MiscEvent
source§fn as_ref(&self) -> &input_event
fn as_ref(&self) -> &input_event
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<'de> Deserialize<'de> for MiscEvent
impl<'de> Deserialize<'de> for MiscEvent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> From<&'a MiscEvent> for &'a InputEvent
impl<'a> From<&'a MiscEvent> for &'a InputEvent
source§impl<'a> From<&'a MiscEvent> for InputEvent
impl<'a> From<&'a MiscEvent> for InputEvent
source§impl From<MiscEvent> for InputEvent
impl From<MiscEvent> for InputEvent
source§impl GenericEvent for MiscEvent
impl GenericEvent for MiscEvent
source§fn event_kind(&self) -> EventKind
fn event_kind(&self) -> EventKind
The event kind.
source§fn with_event(event: InputEvent) -> Result<Self, RangeError>
fn with_event(event: InputEvent) -> Result<Self, RangeError>
Interprets a generic event into a concrete event type.
source§unsafe fn with_event_unchecked(event: InputEvent) -> Self
unsafe fn with_event_unchecked(event: InputEvent) -> Self
Interprets a generic event into a concrete event type. Read more
source§fn from_ref(event: &InputEvent) -> Result<&Self, RangeError>
fn from_ref(event: &InputEvent) -> Result<&Self, RangeError>
Interprets a generic event reference into a concrete event type.
source§fn from_mut(event: &mut InputEvent) -> Result<&mut Self, RangeError>
fn from_mut(event: &mut InputEvent) -> Result<&mut Self, RangeError>
Interprets a mutable generic event reference into a concrete event type.
source§impl Ord for MiscEvent
impl Ord for MiscEvent
source§impl PartialEq for MiscEvent
impl PartialEq for MiscEvent
source§impl PartialOrd for MiscEvent
impl PartialOrd for MiscEvent
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 moresource§impl<'a> TryFrom<&'a InputEvent> for &'a MiscEvent
impl<'a> TryFrom<&'a InputEvent> for &'a MiscEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl<'a> TryFrom<&'a mut InputEvent> for &'a mut MiscEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut MiscEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for MiscEvent
impl TryFrom<InputEvent> for MiscEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
impl Copy for MiscEvent
impl Eq for MiscEvent
impl StructuralPartialEq for MiscEvent
Auto Trait Implementations§
impl Freeze for MiscEvent
impl RefUnwindSafe for MiscEvent
impl Send for MiscEvent
impl Sync for MiscEvent
impl Unpin for MiscEvent
impl UnwindSafe for MiscEvent
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)