pub struct DragRecognizer { /* private fields */ }Expand description
Stateful drag gesture recognizer.
Implementations§
Source§impl DragRecognizer
impl DragRecognizer
Sourcepub fn new(settings: DragSettings) -> Self
pub fn new(settings: DragSettings) -> Self
Creates a drag recognizer with custom settings.
Sourcepub fn update(
&mut self,
pass: PointerEventPass,
pointer_changes: &mut [PointerChange],
within_bounds: bool,
) -> DragResult
pub fn update( &mut self, pass: PointerEventPass, pointer_changes: &mut [PointerChange], within_bounds: bool, ) -> DragResult
Updates the recognizer with the current pointer pass and events.
§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 set_settings(&mut self, settings: DragSettings)
pub fn set_settings(&mut self, settings: DragSettings)
Replaces the recognizer settings while preserving active gesture state.
Sourcepub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Returns whether dragging is currently active.
Trait Implementations§
Source§impl Clone for DragRecognizer
impl Clone for DragRecognizer
Source§fn clone(&self) -> DragRecognizer
fn clone(&self) -> DragRecognizer
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 DragRecognizer
Source§impl Debug for DragRecognizer
impl Debug for DragRecognizer
Source§impl Default for DragRecognizer
impl Default for DragRecognizer
Source§fn default() -> DragRecognizer
fn default() -> DragRecognizer
Returns the “default value” for a type. Read more
Source§impl PartialEq for DragRecognizer
impl PartialEq for DragRecognizer
impl StructuralPartialEq for DragRecognizer
Auto Trait Implementations§
impl Freeze for DragRecognizer
impl RefUnwindSafe for DragRecognizer
impl Send for DragRecognizer
impl Sync for DragRecognizer
impl Unpin for DragRecognizer
impl UnsafeUnpin for DragRecognizer
impl UnwindSafe for DragRecognizer
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.