#[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
                  |
                  +-> CANCELA 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<EventPhase>
pub const fn into_primitive(self) -> u32
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> Decode<EventPhase, D> for EventPhasewhere
    D: ResourceDialect,
 
impl<D> Decode<EventPhase, D> for EventPhasewhere
    D: ResourceDialect,
Source§fn new_empty() -> EventPhase
 
fn new_empty() -> EventPhase
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl<D> Encode<EventPhase, D> for EventPhasewhere
    D: ResourceDialect,
 
impl<D> Encode<EventPhase, D> for EventPhasewhere
    D: ResourceDialect,
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 moreSource§fn borrow(
    value: &<EventPhase as TypeMarker>::Owned,
) -> <EventPhase as ValueTypeMarker>::Borrowed<'_>
 
fn borrow( value: &<EventPhase as TypeMarker>::Owned, ) -> <EventPhase as ValueTypeMarker>::Borrowed<'_>
&Self::Owned to Self::Borrowed.