Struct reis::ei::device::Device

source ·
pub struct Device(/* private fields */);

Implementations§

source§

impl Device

source

pub fn version(&self) -> u32

source§

impl Device

source

pub fn release(&self)

Notification that the client is no longer interested in this device.

Note that releasing a device does not guarantee another device becomes available.

The EIS implementation will release any resources related to this device and send the ei_device.destroyed event once complete.

source

pub fn start_emulating(&self, last_serial: u32, sequence: u32)

Notify the EIS implementation that the given device is about to start sending events. This should be seen more as a transactional boundary than a time-based boundary. The primary use-cases for this are to allow for setup on the EIS implementation side and/or UI updates to indicate that a device is sending events now and for out-of-band information to sync with a given event sequence.

There is no actual requirement that events start immediately once emulation starts and there is no requirement that a client calls ei_device.stop_emulating after the most recent events. For example, in a remote desktop use-case the client would call ei_device.start_emulating once the remote desktop session starts (rather than when the device sends events) and ei_device.stop_emulating once the remote desktop session stops.

The sequence number identifies this transaction between start/stop emulating. It must go up by at least 1 on each call to ei_device.start_emulating. Wraparound must be handled by the EIS implementation but callers must ensure that detection of wraparound is possible.

It is a protocol violation to request ei_device.start_emulating after ei_device.start_emulating without an intermediate stop_emulating.

It is a protocol violation to send this request for a client of an ei_handshake.context_type other than sender.

source

pub fn stop_emulating(&self, last_serial: u32)

Notify the EIS implementation that the given device is no longer sending events. See ei_device.start_emulating for details.

It is a protocol violation to send this request for a client of an ei_handshake.context_type other than sender.

source

pub fn frame(&self, last_serial: u32, timestamp: u64)

Generate a frame event to group the current set of events into a logical hardware event. This function must be called after one or more events on any of ei_pointer, ei_pointer_absolute, ei_scroll, ei_button, ei_keyboard or ei_touchscreen has been requested by the EIS implementation.

The EIS implementation should not process changes to the device state until the ei_device.frame event. For example, pressing and releasing a key within the same frame is a logical noop.

The given timestamp applies to all events in the current frame. The timestamp must be in microseconds of CLOCK_MONOTONIC.

It is a protocol violation to send this request for a client of an ei_handshake.context_type other than sender.

Trait Implementations§

source§

impl Clone for Device

source§

fn clone(&self) -> Device

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 Device

source§

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

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

impl Hash for Device

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 PartialEq for Device

source§

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

source§

impl StructuralPartialEq for Device

Auto Trait Implementations§

§

impl Freeze for Device

§

impl RefUnwindSafe for Device

§

impl Send for Device

§

impl Sync for Device

§

impl Unpin for Device

§

impl UnwindSafe for Device

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where 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 T
where 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 T
where 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.