pub struct TapRecognizer { /* private fields */ }Expand description
Stateful tap gesture recognizer.
Implementations§
Source§impl TapRecognizer
impl TapRecognizer
Sourcepub fn new(settings: TapSettings) -> Self
pub fn new(settings: TapSettings) -> Self
Creates a tap recognizer with custom settings.
Sourcepub fn update(
&mut self,
pass: PointerEventPass,
pointer_changes: &mut [PointerChange],
within_bounds: bool,
) -> TapResult
pub fn update( &mut self, pass: PointerEventPass, pointer_changes: &mut [PointerChange], within_bounds: bool, ) -> TapResult
Updates the recognizer with the current pointer pass and events.
§Position source
Positions come from the samples themselves in a shared coordinate space.
§Slop origin
The recorded press position anchors slop and movement. A press without a recorded position uses the first movement sample as its origin.
§within_bounds
within_bounds is a semantic flag the caller computes from the node’s
relative coordinates; it reports whether the pointer was inside this
node when the update ran.
Sourcepub fn update_exclusive(
&mut self,
pass: PointerEventPass,
pointer_changes: &mut [PointerChange],
within_bounds: bool,
) -> TapResult
pub fn update_exclusive( &mut self, pass: PointerEventPass, pointer_changes: &mut [PointerChange], within_bounds: bool, ) -> TapResult
Recognizes taps while claiming each press before ancestor tap handlers.
Use for nested click targets. Claims preserve samples for drag and
scroll observers that use Self::update.
Trait Implementations§
Source§impl Clone for TapRecognizer
impl Clone for TapRecognizer
Source§fn clone(&self) -> TapRecognizer
fn clone(&self) -> TapRecognizer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TapRecognizer
Source§impl Debug for TapRecognizer
impl Debug for TapRecognizer
Source§impl Default for TapRecognizer
impl Default for TapRecognizer
Source§fn default() -> TapRecognizer
fn default() -> TapRecognizer
Returns the “default value” for a type. Read more
Source§impl PartialEq for TapRecognizer
impl PartialEq for TapRecognizer
impl StructuralPartialEq for TapRecognizer
Auto Trait Implementations§
impl Freeze for TapRecognizer
impl RefUnwindSafe for TapRecognizer
impl Send for TapRecognizer
impl Sync for TapRecognizer
impl Unpin for TapRecognizer
impl UnsafeUnpin for TapRecognizer
impl UnwindSafe for TapRecognizer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.