Skip to main content

SequenceMember

Struct SequenceMember 

Source
pub struct SequenceMember {
    pub id: WidgetId,
    pub role: MemberRole,
    pub eligible_at: Option<EventTime>,
    pub state: MemberState,
    /* private fields */
}
Expand description

One competitor for a pointer sequence.

Fields§

§id: WidgetId

The competing node.

§role: MemberRole

What it is competing as.

§eligible_at: Option<EventTime>

The earliest time this member may win, when its activation defers it. None means “as soon as its threshold is met”.

§state: MemberState

Where it stands.

Implementations§

Source§

impl SequenceMember

Source

pub fn is_live(&self) -> bool

Whether this member could still win.

Source

pub fn is_eligible_at(&self, now: EventTime) -> bool

Whether this member may win at now. A member deferred by DragActivation::AfterLongPress cannot win before its timer, and a holding member cannot win at all until it releases.

Source

pub fn own_drag_armed_at(&self, now: EventTime) -> bool

Whether this member’s node may run its own drag/swipe recognizers at now.

Always true for a member carrying no self-drag deferral — which is every member a mouse ever enrols, and every member of every sequence on a node that is not dual-role — so this predicate is inert everywhere the dual-role shape does not occur.

Three answers, and the third is the load-bearing one:

  • no self-drag → true, unconditionally;
  • a self-drag still inside its deferral → false until now reaches own_drag_eligible_at;
  • a withdrawn self-drag → false for the rest of the press, and deliberately so. A withdrawal means the press is not the hold the deferral was waiting for — the pan half took it, or the travel disproved the hold — and the node’s recognizers must stay silenced afterwards, or a deferral ripening later would start the node’s drag under a finger that had already committed to something else. Because the gate this feeds (WidgetTree::sequence_blocks_arena’s rule) is per node, that silence covers the node’s tap family too, which is the same thing WidgetTree::cancel_member_taps does to the pan winner explicitly. For a dual-role node mid-pan that is the wanted answer: a finger that has committed to a pan is not also tapping, double-tapping or long-pressing the surface it is panning. A completed tap is not lost to it either way: end_sequence nulls the sequence before the release is dispatched, and TapRecognizer decides the release against its own TapBoundary, so a press that wandered and lifted inside the node still taps.

Trait Implementations§

Source§

impl Clone for SequenceMember

Source§

fn clone(&self) -> SequenceMember

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 Copy for SequenceMember

Source§

impl Debug for SequenceMember

Source§

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

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

impl PartialEq for SequenceMember

Source§

fn eq(&self, other: &SequenceMember) -> 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 SequenceMember

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.