pub struct Tracker { /* private fields */ }Available on crate feature
tappable only.Expand description
The gesture logic of a tappable, free of any widget, so it can be driven and tested directly.
Implementations§
Source§impl Tracker
impl Tracker
Sourcepub fn press(&mut self, pointer: Pointer, position: Point, now: Instant)
pub fn press(&mut self, pointer: Pointer, position: Point, now: Instant)
A press started at position. A second finger while one is down
cancels instead, since two fingers are a pinch rather than a tap.
Sourcepub fn moved(&mut self, pointer: Pointer, position: Point, slop: f32)
pub fn moved(&mut self, pointer: Pointer, position: Point, slop: f32)
The pointer moved. Beyond slop from where it started, the press is
cancelled.
Sourcepub fn release(&mut self, pointer: Pointer, inside: bool) -> Option<Gesture>
pub fn release(&mut self, pointer: Pointer, inside: bool) -> Option<Gesture>
The pointer was lifted. A press that was not held and ends inside
is a tap.
Sourcepub fn tick(&mut self, now: Instant, hold: Duration) -> Option<Gesture>
pub fn tick(&mut self, now: Instant, hold: Duration) -> Option<Gesture>
Checks the clock. Once a press has been held for hold, it becomes
a long press, reported once, and its release is then ignored.
Sourcepub fn deadline(&self, hold: Duration) -> Option<Instant>
pub fn deadline(&self, hold: Duration) -> Option<Instant>
When the current press becomes a long press, if one is pending.
Sourcepub fn mouse_moved(&mut self)
pub fn mouse_moved(&mut self)
A real mouse moved, so hover can be shown again.
pub fn is_pressed(&self) -> bool
Trait Implementations§
impl Copy for Tracker
impl StructuralPartialEq for Tracker
Auto Trait Implementations§
impl Freeze for Tracker
impl RefUnwindSafe for Tracker
impl Send for Tracker
impl Sync for Tracker
impl Unpin for Tracker
impl UnsafeUnpin for Tracker
impl UnwindSafe for Tracker
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Turns some type into the initial state of some
Application.