#[repr(u32)]pub enum EventPhase {
Add = 1,
Change = 2,
Remove = 3,
Cancel = 4,
}
Expand description
The possible states of a pointer event. These phases of events in a stream
follow a state machine that starts with the ADD
phase, followed by zero or
more CHANGE
phases, and finally terminates with REMOVE
or CANCEL
phase.
ADD ---> CHANGE* -+-> REMOVE
|
+-> CANCEL
A finite sequence of pointer events that follows this state machine, starting from the initial state, is called an interaction. A closed (or past) interaction is one where it has reached the terminal state; an open (or current) interaction is one where it has not.
For a given device pointer, a stream of events is observed as a succession of zero or more closed interactions (the past history of user engagement), followed by at most one open interaction (the current user engagement).
When we need to group pointer events by their interaction, an event carries an interaction id that is unique in that pointer stream. This common reference makes it possible to operate on a closed interaction, as well as an open interaction.
For example, touch events are typically observed as a succession of interactions, as fingers engage and disengage with the display.
Variants§
Add = 1
The device has started tracking the pointer.
Change = 2
The device has reported an update to the pointer state.
Remove = 3
The device has stopped tracking the pointer.
Cancel = 4
The pointer is no longer available.
Implementations§
Source§impl EventPhase
impl EventPhase
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
Source§impl Clone for EventPhase
impl Clone for EventPhase
Source§fn clone(&self) -> EventPhase
fn clone(&self) -> EventPhase
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EventPhase
impl Debug for EventPhase
Source§impl<D: ResourceDialect> Decode<EventPhase, D> for EventPhase
impl<D: ResourceDialect> Decode<EventPhase, D> for EventPhase
Source§impl<D: ResourceDialect> Encode<EventPhase, D> for EventPhase
impl<D: ResourceDialect> Encode<EventPhase, D> for EventPhase
Source§impl Hash for EventPhase
impl Hash for EventPhase
Source§impl Ord for EventPhase
impl Ord for EventPhase
Source§fn cmp(&self, other: &EventPhase) -> Ordering
fn cmp(&self, other: &EventPhase) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for EventPhase
impl PartialEq for EventPhase
Source§impl PartialOrd for EventPhase
impl PartialOrd for EventPhase
Source§impl TypeMarker for EventPhase
impl TypeMarker for EventPhase
Source§type Owned = EventPhase
type Owned = EventPhase
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for EventPhase
impl ValueTypeMarker for EventPhase
Source§type Borrowed<'a> = EventPhase
type Borrowed<'a> = EventPhase
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreimpl Copy for EventPhase
impl Eq for EventPhase
impl StructuralPartialEq for EventPhase
Auto Trait Implementations§
impl Freeze for EventPhase
impl RefUnwindSafe for EventPhase
impl Send for EventPhase
impl Sync for EventPhase
impl Unpin for EventPhase
impl UnwindSafe for EventPhase
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
)