[go: up one dir, main page]

reis::eis::device

Enum Request

source
#[non_exhaustive]
pub enum Request { Release, StartEmulating { last_serial: u32, sequence: u32, }, StopEmulating { last_serial: u32, }, Frame { last_serial: u32, timestamp: u64, }, }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Release

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.

§

StartEmulating

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.

Fields

§last_serial: u32

the last serial sent by the EIS implementation

§sequence: u32

sequence number to identify this emulation sequence

§

StopEmulating

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.

Fields

§last_serial: u32

the last serial sent by the EIS implementation

§

Frame

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.

Fields

§last_serial: u32

the last serial sent by the EIS implementation

§timestamp: u64

timestamp in microseconds

Trait Implementations§

source§

impl Debug for Request

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

source§

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>,

source§

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.