pub struct SwipeableConfig {
pub animation_spec: AnimationSpec,
pub positional_threshold: f32,
pub velocity_threshold: f32,
pub max_overshoot: f32,
}Expand description
Configuration for a SwipeableState.
Fields§
§animation_spec: AnimationSpecHow the offset animates to the target anchor on release (default: spring_gentle).
positional_threshold: f32Fractional threshold between anchors for positional snapping (0.0–1.0). 0.3 means the swipe must cross 30% of the gap to snap to the next anchor.
velocity_threshold: f32Velocity threshold in px/s. If the release velocity exceeds this,
the offset snaps to the anchor in the direction of movement regardless
of positional threshold. Set to f32::MAX to disable velocity-based snapping.
max_overshoot: f32Maximum offset past the first/last anchor (resistance). 0 = no limit.
Trait Implementations§
Source§impl Clone for SwipeableConfig
impl Clone for SwipeableConfig
Source§fn clone(&self) -> SwipeableConfig
fn clone(&self) -> SwipeableConfig
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 moreAuto Trait Implementations§
impl Freeze for SwipeableConfig
impl RefUnwindSafe for SwipeableConfig
impl Send for SwipeableConfig
impl Sync for SwipeableConfig
impl Unpin for SwipeableConfig
impl UnsafeUnpin for SwipeableConfig
impl UnwindSafe for SwipeableConfig
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