Expand description
Pluggable, zero-allocation scroll physics engine, composable Flutter-style ScrollBehavior
decorators, platform presets (ScrollPhysicsProfile / PlatformScrollPhysics), and
sparse per-container ScrollPhysics (nv.scroll_physics) overrides.
Backed directly by nativeview-physics closed-form solvers (DecaySpec, RubberBandSpec,
SmoothWheelSpec, SpringSpec/SpringState, VelocityTracker) with zero duplicated math.
Structs§
- Active
Scroll Axis - Per-axis closed-form scroll physics state (
Copy, zero heap fields). - Active
Scroll Entry - Active scroll physics record for one animated/stretched
Scrollcontainer (Copy, 0 heap). - Clamp
Boundary - Hard-clamped scroll boundary: stops at
[0..=max]with zero rubber-band overscroll. - Composed
Scroll Behavior - Zero-overhead static combinator stacking independent boundary, fling, snap, wheel, and spring return decorators.
- Detent
Snap - Zero-allocation inline snap detents (
[f32; 8]+len: u8) for bottom sheets, drawers, and irregular card carousels. - Explicit
Rubber Band Boundary - Explicit-request (opt-in) rubber-band boundary (Windows/Linux desktop default): hard-clamps plain containers
while honoring
Scroll::bounce(true)andScrollBoundaryMode::Bounce. - Exponential
Decay Fling - Exponentially decelerating inertial fling backed by
DecaySpec. - Fixed
Extent Snap - Snaps to regular fixed-extent item offsets (
leading_offset + k * item_extent). - Free
Scroll - Free scrolling with no snap points.
- Instant
Wheel - Immediate deterministic discrete wheel detents with zero smoothing animation.
- NoFling
- Disables post-release inertial fling momentum.
- Page
Snap - Snaps to integer multiples of the container’s viewport extent (carousel / pager semantics).
- Pooled
Scroll Physics - Rubber
Band Boundary - Elastic Apple/Android-style rubber-band overscroll boundary enabled by default.
- Scroll
Physics - Optional per-container scroll physics overrides (
nv.scroll_physics, sparse, 0 B when absent). - Smooth
Wheel - Exponentially smoothed discrete wheel detents backed by
SmoothWheelSpec. - Snap
Query - Read-only release kinematics passed to
SnapPhysics::snap_target. - Spring
Return - Return & snap spring specification wrapping
SpringSpec.
Enums§
- Axis
Phase - Lifecycle phase of one scroll container axis inside
crate::PooledScrollPhysics. - Scroll
Boundary Mode - Per-container boundary resistance override for
ScrollPhysics. - Scroll
Physics Profile - Platform-tuned scroll physics profile (
deceleration, spring frequency, wheel line step, smooth-wheel time constant, and default rubber-band elasticity). - Scroll
Snap Mode - Per-container snap-point mode override for
ScrollPhysics.
Constants§
- MAX_
ACTIVE_ SCROLL_ ENTRIES - Upper bound on concurrently active/stretched scroll containers tracked in
PooledScrollPhysics. - MAX_
DETENT_ STOPS - Maximum inline snap detents supported by
DetentSnapwith zero heap allocation.
Traits§
- Boundary
Physics - Boundary overscroll resistance policy.
- Fling
Physics - Inertial fling momentum policy after trackpad/touch release.
- Scroll
Behavior - Unified scroll behavior contract consumed by
PooledScrollPhysics. - Snap
Physics - Post-release snap-point targeting policy.
- Wheel
Physics - Discrete mouse-wheel easing policy.
Functions§
- install_
platform_ scroll_ physics - Convenience helper installing
PlatformScrollPhysics::platform_default()ontoscene. - rubber_
band_ forward - Apple asymptote rubber-band drag resistance:
sign(raw) * c*|raw|*D / (D + c*|raw|). - rubber_
band_ inverse - Exact inverse of
rubber_band_forwardfor smooth drag unwinding.
Type Aliases§
- Platform
Scroll Physics - Platform-preset
PooledScrollPhysicsengine ready to install ontoLaidOutScene,SkiaBackend, orDesktopSession.