Struct EdgeSwipeBack
pub struct EdgeSwipeBack { /* private fields */ }Expand description
Arms when a press starts within edge_width of the left edge, fires
NavAction::Back once the pointer travels trigger_distance px right
in a mostly-horizontal drag. No velocity/animation, but a complete
pointer-event contract a richer recognizer can later drop into.
Implementations§
§impl EdgeSwipeBack
impl EdgeSwipeBack
pub fn new(edge_width: f64, trigger_distance: f64) -> EdgeSwipeBack
pub fn new(edge_width: f64, trigger_distance: f64) -> EdgeSwipeBack
A recognizer for a left-edge back swipe. edge_width is how far from the
left edge a press must start to arm; trigger_distance is the rightward
travel that fires Back.
pub fn default_back() -> EdgeSwipeBack
pub fn default_back() -> EdgeSwipeBack
A sensible default: arm within 24px of the left edge, fire after 80px of rightward travel.
pub fn pointer_down(&mut self, p: Point)
pub fn pointer_down(&mut self, p: Point)
A pointer press landed at p (logical coords, relative to the surface’s
left edge). Arms the recognizer when the press is inside the edge zone.
pub fn pointer_move(&mut self, p: Point) -> Option<NavAction>
pub fn pointer_move(&mut self, p: Point) -> Option<NavAction>
The pointer moved to p. Returns NavAction::Back exactly once, on the
frame the horizontal travel first exceeds the trigger distance while the
gesture stays predominantly horizontal. None otherwise.
pub fn pointer_up(&mut self)
pub fn pointer_up(&mut self)
The pointer was released / capture ended — disarm for the next gesture.
Trait Implementations§
§impl Clone for EdgeSwipeBack
impl Clone for EdgeSwipeBack
§fn clone(&self) -> EdgeSwipeBack
fn clone(&self) -> EdgeSwipeBack
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for EdgeSwipeBack
impl Debug for EdgeSwipeBack
§impl Default for EdgeSwipeBack
impl Default for EdgeSwipeBack
§fn default() -> EdgeSwipeBack
fn default() -> EdgeSwipeBack
Auto Trait Implementations§
impl Freeze for EdgeSwipeBack
impl RefUnwindSafe for EdgeSwipeBack
impl Send for EdgeSwipeBack
impl Sync for EdgeSwipeBack
impl Unpin for EdgeSwipeBack
impl UnsafeUnpin for EdgeSwipeBack
impl UnwindSafe for EdgeSwipeBack
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more