Struct input_linux::RelativeEvent
source · #[repr(C)]pub struct RelativeEvent {
pub time: EventTime,
pub axis: RelativeAxis,
pub value: i32,
/* private fields */
}
Expand description
Events that occur when the state of a relative axis is changed.
Fields§
§time: EventTime
The timestamp associated with the event.
axis: RelativeAxis
The axis associated with the event.
value: i32
The relative distance of the axis event.
Implementations§
source§impl<'a> RelativeEvent
impl<'a> RelativeEvent
sourcepub const fn new(time: EventTime, axis: RelativeAxis, value: i32) -> Self
pub const fn new(time: EventTime, axis: RelativeAxis, 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 RelativeEvent
impl AsRef<InputEvent> for RelativeEvent
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 RelativeEvent
impl AsRef<input_event> for RelativeEvent
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 Clone for RelativeEvent
impl Clone for RelativeEvent
source§fn clone(&self) -> RelativeEvent
fn clone(&self) -> RelativeEvent
Returns a copy 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 RelativeEvent
impl Debug for RelativeEvent
source§impl<'de> Deserialize<'de> for RelativeEvent
impl<'de> Deserialize<'de> for RelativeEvent
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 RelativeEvent> for &'a InputEvent
impl<'a> From<&'a RelativeEvent> for &'a InputEvent
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 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 RelativeEvent> for InputEvent
impl<'a> From<&'a RelativeEvent> for InputEvent
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 mut RelativeEvent> for EventMut<'a>
impl<'a> From<&'a mut RelativeEvent> for EventMut<'a>
source§fn from(event: &'a mut RelativeEvent) -> Self
fn from(event: &'a mut RelativeEvent) -> Self
Converts to this type from the input type.
source§impl From<RelativeEvent> for Event
impl From<RelativeEvent> for Event
source§fn from(event: RelativeEvent) -> Self
fn from(event: RelativeEvent) -> Self
Converts to this type from the input type.
source§impl From<RelativeEvent> for InputEvent
impl From<RelativeEvent> for InputEvent
source§fn from(event: RelativeEvent) -> Self
fn from(event: RelativeEvent) -> Self
Converts to this type from the input type.
source§impl GenericEvent for RelativeEvent
impl GenericEvent for RelativeEvent
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 Hash for RelativeEvent
impl Hash for RelativeEvent
source§impl Ord for RelativeEvent
impl Ord for RelativeEvent
source§fn cmp(&self, other: &RelativeEvent) -> Ordering
fn cmp(&self, other: &RelativeEvent) -> Ordering
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 PartialEq for RelativeEvent
impl PartialEq for RelativeEvent
source§impl PartialOrd for RelativeEvent
impl PartialOrd for RelativeEvent
source§impl Serialize for RelativeEvent
impl Serialize for RelativeEvent
source§impl<'a> TryFrom<&'a InputEvent> for &'a RelativeEvent
impl<'a> TryFrom<&'a InputEvent> for &'a RelativeEvent
§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 RelativeEvent
impl<'a> TryFrom<&'a mut InputEvent> for &'a mut RelativeEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
source§impl TryFrom<InputEvent> for RelativeEvent
impl TryFrom<InputEvent> for RelativeEvent
§type Error = RangeError
type Error = RangeError
The type returned in the event of a conversion error.
impl Copy for RelativeEvent
impl Eq for RelativeEvent
impl StructuralPartialEq for RelativeEvent
Auto Trait Implementations§
impl Freeze for RelativeEvent
impl RefUnwindSafe for RelativeEvent
impl Send for RelativeEvent
impl Sync for RelativeEvent
impl Unpin for RelativeEvent
impl UnwindSafe for RelativeEvent
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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
)