Skip to main content

PointerEntry

Struct PointerEntry 

Source
#[non_exhaustive]
pub struct PointerEntry { pub info: PointerInfo, pub position: Point, pub down_position: Point, pub hovered: Option<WidgetId>, pub captured_by: Option<WidgetId>, pub hover_within: Vec<WidgetId>, pub sequence: Option<PointerSequence>, pub last_accepted: Option<WidgetId>, }
Expand description

Everything the tree tracks about one live pointer.

One of these exists from the pointer’s first sample until it lifts (a contact) or the window loses it (a hovering pointer never lifts, so a mouse’s entry persists for the life of the tree once it has been seen).

#[non_exhaustive]: the velocity tracker lands here in a later package (the gesture-sequence handle already has), and it should not break a construction site.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§info: PointerInfo

Who this pointer is, as of its most recent sample.

§position: Point

Where it is now, in window-logical coordinates.

§down_position: Point

Where its most recent press landed. Equal to position until the first press, so a slop test against it is never nonsense.

§hovered: Option<WidgetId>

The widget it is hovering, if it is a hovering-capable pointer that currently holds the hover-owner role. Always None for a contact.

§captured_by: Option<WidgetId>

The widget that captured this pointer. Capture is per pointer: two contacts hold independent captures, and each is released only by its own Up or Cancel.

§hover_within: Vec<WidgetId>

Strict ancestors of hovered whose hover_within signal this pointer currently holds true.

§sequence: Option<PointerSequence>

The arbitration in progress for this pointer’s press: who is competing for it, and who won. None between presses — a hovering mouse has an entry but no sequence. See PointerSequence.

§last_accepted: Option<WidgetId>

The last widget that answered Handled to one of this pointer’s positional events.

The fallback recipient of a PointerCancel when the pointer holds no capture: something was interacting with this pointer, and it is the only thing the tree can name. Kept per pointer rather than per tree, because two contacts on two widgets each have their own answer.

Implementations§

Source§

impl PointerEntry

Source

pub fn hovers(&self) -> bool

Whether this pointer can report a position without a button held, and so can own hover. See PointerKind::hovers.

Source

pub fn is_contacting(&self) -> bool

Whether this pointer is touching the surface: a contact is touching for as long as it is live, a hovering-capable pointer only while a button is held.

Trait Implementations§

Source§

impl Clone for PointerEntry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PointerEntry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PointerEntry

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PointerEntry

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.