pub struct PointerId(/* private fields */);Expand description
A process-unique, monotonically increasing pointer identity.
Minted per press by PointerIdAllocator (see the module docs for why per
press rather than per device). NonZeroU64 so Option<PointerId> is the
same size as PointerId, and so id 0 can never be confused with “no
pointer”.
Ordering is by mint order, which makes a BTreeMap<PointerId, _> iterate
oldest contact first — the order a multi-touch consumer wants.
Implementations§
Source§impl PointerId
impl PointerId
Sourcepub const MOUSE: Self
pub const MOUSE: Self
The one stable id every synthesized mouse event uses.
A mouse is singular: there is at most one of it, it never lifts, and
nothing about it needs a per-press identity. Reserving id 1 for it keeps
the legacy dispatch_event path allocation-free and makes “is this the
mouse?” a comparison rather than a lookup.
Trait Implementations§
impl Copy for PointerId
impl Eq for PointerId
Source§impl Ord for PointerId
impl Ord for PointerId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for PointerId
impl PartialOrd for PointerId
impl StructuralPartialEq for PointerId
Auto Trait Implementations§
impl Freeze for PointerId
impl RefUnwindSafe for PointerId
impl Send for PointerId
impl Sync for PointerId
impl Unpin for PointerId
impl UnsafeUnpin for PointerId
impl UnwindSafe for PointerId
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
Mutably borrows from an owned value. Read more