Struct input_linux::InputEvent

source ·
#[repr(C)]
pub struct InputEvent { pub time: EventTime, pub kind: EventKind, pub code: u16, pub value: i32, }
Expand description

A generic event.

Fields§

§time: EventTime

The timestamp associated with the event.

§kind: EventKind

The type of event that occurred.

§code: u16

The code of the event.

The meaning of this code depends on the kind of event. Using the typed events via Event and EventRef is recommended.

§value: i32

The value of the event.

The interpretation of this value depends on the kind of event.

Implementations§

source§

impl InputEvent

source

pub fn as_bytes(&self) -> &[u8; 16]

Reinterpret this event as an array of bytes

source§

impl InputEvent

source

pub fn from_raw(event: &input_event) -> Result<&Self, RangeError>

Reinterprets a raw [input_event].

source

pub fn from_raw_mut(event: &mut input_event) -> Result<&mut Self, RangeError>

Reinterprets a raw [input_event] into a mutable reference.

source

pub fn as_raw(&self) -> &input_event

Reinterprets the event as a raw [input_event].

source

pub unsafe fn as_raw_mut(&mut self) -> &mut input_event

Reinterprets the event as a mutable raw [input_event].

Trait Implementations§

source§

impl AsRef<InputEvent> for AbsoluteEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for AutorepeatEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for Event

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> AsRef<InputEvent> for EventMut<'a>

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<'a> AsRef<InputEvent> for EventRef<'a>

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for InputEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for KeyEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for LedEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for MiscEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for RelativeEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for SoundEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for SwitchEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for SynchronizeEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<InputEvent> for UInputEvent

source§

fn as_ref(&self) -> &InputEvent

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<input_event> for InputEvent

source§

fn as_ref(&self) -> &input_event

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for InputEvent

source§

fn clone(&self) -> InputEvent

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for InputEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for InputEvent

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Encoder<InputEvent> for EventCodec

Available on crate features tokio-util-0_7 and codec only.
§

type Error = Error

The type of encoding errors. Read more
§

fn encode( &mut self, item: InputEvent, dst: &mut BytesMut ) -> Result<(), Self::Error>

Encodes a frame into the buffer provided. Read more
§

impl Encoder<InputEvent> for EventCodec

Available on crate features tokio-util-0_6 and codec only.
§

type Error = Error

The type of encoding errors. Read more
§

fn encode( &mut self, item: InputEvent, dst: &mut BytesMut ) -> Result<(), Self::Error>

Encodes a frame into the buffer provided. Read more
source§

impl<'a> From<&'a AbsoluteEvent> for &'a InputEvent

source§

fn from(event: &'a AbsoluteEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a AbsoluteEvent> for InputEvent

source§

fn from(event: &'a AbsoluteEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a AutorepeatEvent> for &'a InputEvent

source§

fn from(event: &'a AutorepeatEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a AutorepeatEvent> for InputEvent

source§

fn from(event: &'a AutorepeatEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a EventMut<'a>> for &'a InputEvent

source§

fn from(event: &'a EventMut<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a KeyEvent> for &'a InputEvent

source§

fn from(event: &'a KeyEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a KeyEvent> for InputEvent

source§

fn from(event: &'a KeyEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a LedEvent> for &'a InputEvent

source§

fn from(event: &'a LedEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a LedEvent> for InputEvent

source§

fn from(event: &'a LedEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a MiscEvent> for &'a InputEvent

source§

fn from(event: &'a MiscEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a MiscEvent> for InputEvent

source§

fn from(event: &'a MiscEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a RelativeEvent> for &'a InputEvent

source§

fn from(event: &'a RelativeEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a RelativeEvent> for InputEvent

source§

fn from(event: &'a RelativeEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a SoundEvent> for &'a InputEvent

source§

fn from(event: &'a SoundEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a SoundEvent> for InputEvent

source§

fn from(event: &'a SoundEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a SwitchEvent> for &'a InputEvent

source§

fn from(event: &'a SwitchEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a SwitchEvent> for InputEvent

source§

fn from(event: &'a SwitchEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a SynchronizeEvent> for &'a InputEvent

source§

fn from(event: &'a SynchronizeEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a SynchronizeEvent> for InputEvent

source§

fn from(event: &'a SynchronizeEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a UInputEvent> for &'a InputEvent

source§

fn from(event: &'a UInputEvent) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a UInputEvent> for InputEvent

source§

fn from(event: &'a UInputEvent) -> Self

Converts to this type from the input type.
source§

impl From<AbsoluteEvent> for InputEvent

source§

fn from(event: AbsoluteEvent) -> Self

Converts to this type from the input type.
source§

impl From<AutorepeatEvent> for InputEvent

source§

fn from(event: AutorepeatEvent) -> Self

Converts to this type from the input type.
source§

impl From<Event> for InputEvent

source§

fn from(event: Event) -> Self

Converts to this type from the input type.
source§

impl<'a> From<EventRef<'a>> for &'a InputEvent

source§

fn from(event: EventRef<'a>) -> Self

Converts to this type from the input type.
source§

impl From<KeyEvent> for InputEvent

source§

fn from(event: KeyEvent) -> Self

Converts to this type from the input type.
source§

impl From<LedEvent> for InputEvent

source§

fn from(event: LedEvent) -> Self

Converts to this type from the input type.
source§

impl From<MiscEvent> for InputEvent

source§

fn from(event: MiscEvent) -> Self

Converts to this type from the input type.
source§

impl From<RelativeEvent> for InputEvent

source§

fn from(event: RelativeEvent) -> Self

Converts to this type from the input type.
source§

impl From<SoundEvent> for InputEvent

source§

fn from(event: SoundEvent) -> Self

Converts to this type from the input type.
source§

impl From<SwitchEvent> for InputEvent

source§

fn from(event: SwitchEvent) -> Self

Converts to this type from the input type.
source§

impl From<SynchronizeEvent> for InputEvent

source§

fn from(event: SynchronizeEvent) -> Self

Converts to this type from the input type.
source§

impl From<UInputEvent> for InputEvent

source§

fn from(event: UInputEvent) -> Self

Converts to this type from the input type.
source§

impl GenericEvent for InputEvent

source§

fn event_kind(&self) -> EventKind

The event kind.
source§

fn time(&self) -> &EventTime

The timestamp associated with the event.
source§

fn code(&self) -> u16

The type code value of the event.
source§

fn value(&self) -> i32

The value associated with the event.
source§

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>

Interprets a mutable generic event reference into a concrete event type.
source§

impl Hash for InputEvent

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for InputEvent

source§

fn cmp(&self, other: &InputEvent) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<InputEvent> for InputEvent

source§

fn eq(&self, other: &InputEvent) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<InputEvent> for InputEvent

source§

fn partial_cmp(&self, other: &InputEvent) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for InputEvent

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> TryFrom<&'a InputEvent> for &'a AbsoluteEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a AutorepeatEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a KeyEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a LedEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a MiscEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a RelativeEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a SoundEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a SwitchEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a SynchronizeEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a InputEvent> for &'a UInputEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut AbsoluteEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut AutorepeatEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut KeyEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut LedEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut MiscEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut RelativeEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut SoundEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut SwitchEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut SynchronizeEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a mut InputEvent> for &'a mut UInputEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: &'a mut InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for AbsoluteEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for AutorepeatEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for KeyEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for LedEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for MiscEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for RelativeEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for SoundEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for SwitchEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for SynchronizeEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<InputEvent> for UInputEvent

§

type Error = RangeError

The type returned in the event of a conversion error.
source§

fn try_from(event: InputEvent) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for InputEvent

source§

impl Eq for InputEvent

source§

impl StructuralEq for InputEvent

source§

impl StructuralPartialEq for InputEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,