#[repr(C)]
pub struct virtio_input_event { pub type_: Le16, pub code: Le16, pub value: SLe32, }

Fields§

§type_: Le16§code: Le16§value: SLe32

Implementations§

source§

impl virtio_input_event

source

pub fn syn() -> virtio_input_event

source

pub fn absolute(code: u16, value: i32) -> virtio_input_event

source

pub fn relative(code: u16, value: i32) -> virtio_input_event

source

pub fn multitouch_tracking_id(id: i32) -> virtio_input_event

source

pub fn multitouch_slot(slot: i32) -> virtio_input_event

source

pub fn multitouch_absolute_x(x: i32) -> virtio_input_event

source

pub fn multitouch_absolute_y(y: i32) -> virtio_input_event

source

pub fn absolute_x(x: i32) -> virtio_input_event

source

pub fn absolute_y(y: i32) -> virtio_input_event

source

pub fn relative_x(x: i32) -> virtio_input_event

source

pub fn relative_y(y: i32) -> virtio_input_event

source

pub fn touch(has_contact: bool) -> virtio_input_event

source

pub fn left_click(has_contact: bool) -> virtio_input_event

source

pub fn wheel(delta: i32) -> virtio_input_event

source

pub fn right_click(has_contact: bool) -> virtio_input_event

source

pub fn middle_click(has_contact: bool) -> virtio_input_event

source

pub fn forward_click(has_contact: bool) -> virtio_input_event

source

pub fn back_click(has_contact: bool) -> virtio_input_event

source

pub fn finger_tool(active: bool) -> virtio_input_event

source

pub fn key(code: u16, down: bool, repeat: bool) -> virtio_input_event

Repeated keys must set the repeat option if the key was already down, or repeated keys will not be seen correctly by the guest.

source

pub fn get_led_state(&self, led_code: u16) -> Option<bool>

If the event is EV_LED for the given LED code, return if it is on.

Trait Implementations§

source§

impl AsBytes for virtio_input_eventwhere Le16: AsBytes, SLe32: AsBytes, HasPadding<virtio_input_event, { _ }>: ShouldBe<{ _ }>,

§

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

Gets the bytes of this value. Read more
§

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

Gets the bytes of this value mutably. Read more
§

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

Writes a copy of self to bytes. Read more
§

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

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

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 virtio_input_event

source§

fn clone(&self) -> virtio_input_event

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 virtio_input_event

source§

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

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

impl Default for virtio_input_event

source§

fn default() -> virtio_input_event

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

impl FromBytes for virtio_input_eventwhere Le16: FromBytes, SLe32: FromBytes,

§

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

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

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
§

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
§

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
§

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
§

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
§

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

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

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
§

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
§

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
§

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
§

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
§

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

Reads a copy of Self from bytes. Read more
§

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

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

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 virtio_input_eventwhere Le16: FromZeroes, SLe32: FromZeroes,

§

fn zero(&mut self)

Overwrites self with zeroes. Read more
§

fn new_zeroed() -> Selfwhere Self: Sized,

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

impl InputEventDecoder for virtio_input_event

source§

const SIZE: usize = 8usize

source§

fn decode(data: &[u8]) -> virtio_input_event

source§

impl PartialEq<virtio_input_event> for virtio_input_event

source§

fn eq(&self, other: &virtio_input_event) -> 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 Copy for virtio_input_event

source§

impl Eq for virtio_input_event

source§

impl StructuralEq for virtio_input_event

source§

impl StructuralPartialEq for virtio_input_event

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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.
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.
source§

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

Performs the conversion.