virtio_drivers::device::input

Struct InputEvent

Source
#[repr(C)]
pub struct InputEvent { pub event_type: u16, pub code: u16, pub value: u32, }
Expand description

Both queues use the same virtio_input_event struct. type, code and value are filled according to the Linux input layer (evdev) interface.

Fields§

§event_type: u16

Event type.

§code: u16

Event code.

§value: u32

Event value.

Trait Implementations§

Source§

impl AsBytes for InputEvent
where u16: AsBytes, u32: AsBytes, HasPadding<InputEvent, { _ }>: ShouldBe<false>,

Source§

fn as_bytes(&self) -> &[u8]

Gets the bytes of this value. Read more
Source§

fn as_bytes_mut(&mut self) -> &mut [u8]
where Self: FromBytes,

Gets the bytes of this value mutably. Read more
Source§

fn write_to(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to bytes. Read more
Source§

fn write_to_prefix(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to the prefix of bytes. Read more
Source§

fn write_to_suffix(&self, bytes: &mut [u8]) -> Option<()>

Writes a copy of self to the suffix of bytes. Read more
Source§

impl Clone for InputEvent

Source§

fn clone(&self) -> InputEvent

Returns a copy of the value. Read more
1.0.0§

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 Default for InputEvent

Source§

fn default() -> InputEvent

Returns the “default value” for a type. Read more
Source§

impl FromBytes for InputEvent
where u16: FromBytes, u32: FromBytes,

Source§

fn ref_from(bytes: &[u8]) -> Option<&Self>
where Self: Sized,

Interprets the given bytes as a &Self without copying. Read more
Source§

fn ref_from_prefix(bytes: &[u8]) -> Option<&Self>
where Self: Sized,

Interprets the prefix of the given bytes as a &Self without copying. Read more
Source§

fn ref_from_suffix(bytes: &[u8]) -> Option<&Self>
where Self: Sized,

Interprets the suffix of the given bytes as a &Self without copying. Read more
Source§

fn mut_from(bytes: &mut [u8]) -> Option<&mut Self>
where Self: Sized + AsBytes,

Interprets the given bytes as a &mut Self without copying. Read more
Source§

fn mut_from_prefix(bytes: &mut [u8]) -> Option<&mut Self>
where Self: Sized + AsBytes,

Interprets the prefix of the given bytes as a &mut Self without copying. Read more
Source§

fn mut_from_suffix(bytes: &mut [u8]) -> Option<&mut Self>
where Self: Sized + AsBytes,

Interprets the suffix of the given bytes as a &mut Self without copying. Read more
Source§

fn slice_from(bytes: &[u8]) -> Option<&[Self]>
where Self: Sized,

Interprets the given bytes as a &[Self] without copying. Read more
Source§

fn slice_from_prefix(bytes: &[u8], count: usize) -> Option<(&[Self], &[u8])>
where Self: Sized,

Interprets the prefix of the given bytes as a &[Self] with length equal to count without copying. Read more
Source§

fn slice_from_suffix(bytes: &[u8], count: usize) -> Option<(&[u8], &[Self])>
where Self: Sized,

Interprets the suffix of the given bytes as a &[Self] with length equal to count without copying. Read more
Source§

fn mut_slice_from(bytes: &mut [u8]) -> Option<&mut [Self]>
where Self: Sized + AsBytes,

Interprets the given bytes as a &mut [Self] without copying. Read more
Source§

fn mut_slice_from_prefix( bytes: &mut [u8], count: usize, ) -> Option<(&mut [Self], &mut [u8])>
where Self: Sized + AsBytes,

Interprets the prefix of the given bytes as a &mut [Self] with length equal to count without copying. Read more
Source§

fn mut_slice_from_suffix( bytes: &mut [u8], count: usize, ) -> Option<(&mut [u8], &mut [Self])>
where Self: Sized + AsBytes,

Interprets the suffix of the given bytes as a &mut [Self] with length equal to count without copying. Read more
Source§

fn read_from(bytes: &[u8]) -> Option<Self>
where Self: Sized,

Reads a copy of Self from bytes. Read more
Source§

fn read_from_prefix(bytes: &[u8]) -> Option<Self>
where Self: Sized,

Reads a copy of Self from the prefix of bytes. Read more
Source§

fn read_from_suffix(bytes: &[u8]) -> Option<Self>
where Self: Sized,

Reads a copy of Self from the suffix of bytes. Read more
Source§

impl FromZeroes for InputEvent
where u16: FromZeroes, u32: FromZeroes,

Source§

fn zero(&mut self)

Overwrites self with zeroes. Read more
Source§

fn new_zeroed() -> Self
where Self: Sized,

Creates an instance of Self from zeroed bytes. Read more
Source§

fn new_box_zeroed() -> Box<Self>
where Self: Sized,

Creates a Box<Self> from zeroed bytes. Read more
Source§

fn new_box_slice_zeroed(len: usize) -> Box<[Self]>
where Self: Sized,

Creates a Box<[Self]> (a boxed slice) from zeroed bytes. Read more
Source§

fn new_vec_zeroed(len: usize) -> Vec<Self>
where Self: Sized,

Creates a Vec<Self> from zeroed bytes. Read more
Source§

impl Copy for InputEvent

Auto Trait Implementations§

§

impl Freeze for InputEvent

§

impl RefUnwindSafe for InputEvent

§

impl Send for InputEvent

§

impl Sync for InputEvent

§

impl Unpin for InputEvent

§

impl UnwindSafe for InputEvent

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.