pub struct Device(/* private fields */);Implementations§
source§impl Device
impl Device
sourcepub fn release(&self)
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.
sourcepub fn start_emulating(&self, last_serial: u32, sequence: u32)
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.
sourcepub fn stop_emulating(&self, last_serial: u32)
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.
sourcepub fn frame(&self, last_serial: u32, timestamp: u64)
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§
impl Eq for Device
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)