Skip to main content

PooledScrollPhysics

Struct PooledScrollPhysics 

Source
pub struct PooledScrollPhysics<B: ScrollBehavior> { /* private fields */ }

Implementations§

Source§

impl<B: ScrollBehavior> PooledScrollPhysics<B>

Source

pub fn new(behavior: B) -> Self

Source

pub fn behavior(&self) -> &B

Source

pub fn behavior_mut(&mut self) -> &mut B

Source

pub fn reduced_motion(&self) -> bool

Source

pub fn synthetic_momentum(&self) -> bool

Source

pub fn active_count(&self) -> usize

Source

pub fn entry(&self, id: NodeId) -> Option<&ActiveScrollEntry>

Source§

impl PooledScrollPhysics<ScrollPhysicsProfile>

Source

pub fn platform_default() -> Self

Source

pub fn apple() -> Self

Source

pub fn android() -> Self

Source

pub fn windows() -> Self

Source

pub fn linux() -> Self

Source

pub fn profile(&self) -> ScrollPhysicsProfile

Source

pub fn set_profile(&mut self, profile: ScrollPhysicsProfile)

Trait Implementations§

Source§

impl<B: Clone + ScrollBehavior> Clone for PooledScrollPhysics<B>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<B: Debug + ScrollBehavior> Debug for PooledScrollPhysics<B>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<B: ScrollBehavior + Default> Default for PooledScrollPhysics<B>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<B: ScrollBehavior> ScrollPhysicsEngine for PooledScrollPhysics<B>

Source§

fn on_gesture_start( &mut self, store: &NodeStore, bounds: &dyn ScrollBoundsLookup, start: NodeId, now_ms: ScrollTimestampMs, )

Called on ScrollTouchPhase::Started to latch start, catch in-flight animations on its ancestor chain (stopping at top-layer overlay boundaries), and finalize abandoned drags on other containers.
Source§

fn latched_target(&self) -> Option<NodeId>

Returns the currently latched gesture target node, if any.
Source§

fn on_gesture_move(&mut self, now_ms: ScrollTimestampMs)

Updates monotonic gesture timestamp on ScrollTouchPhase::Moved.
Source§

fn on_scroll_delta( &mut self, ctx: &ScrollContainerCtx<'_>, dx: f32, dy: f32, kind: ScrollInputKind, out: &mut ScrollDeltaResult, )

Consumes (dx, dy) on one scroll container along the ancestor chain. Read more
Source§

fn on_outermost_overscroll( &mut self, ctx: &ScrollContainerCtx<'_>, axis: ScrollAxis, rem: f32, kind: ScrollInputKind, ) -> bool

Feeds leftover unconsumed OverscrollBehavior::Auto delta into the outermost eligible container on axis. Returns true if visual overscroll changed.
Source§

fn on_gesture_end( &mut self, store: &NodeStore, scroll: &mut ScrollOffsets, now_ms: ScrollTimestampMs, cancelled: bool, out_visual: &mut Vec<NodeId>, out_clamped: &mut Vec<NodeId>, )

Called when a phased trackpad/touch gesture ends or is cancelled, transitioning active drags into fling momentum, snap animations, or boundary return springs. Any immediate clamped offset changes must push affected node IDs into both out_visual and out_clamped.
Source§

fn step( &mut self, store: &NodeStore, bounds: &dyn ScrollBoundsLookup, scroll: &mut ScrollOffsets, dt_s: f32, out_visual: &mut Vec<NodeId>, out_clamped: &mut Vec<NodeId>, ) -> bool

Advances all active scroll animations by dt_s seconds, writing clamped offset updates into scroll and pushing affected container IDs into out_visual / out_clamped with zero steady-state heap allocations. Returns true while any animation remains active.
Source§

fn overscroll(&self, id: NodeId) -> (f32, f32)

Active visual overscroll (ox, oy) for node ((0.0, 0.0) when idle).
Source§

fn has_active(&self) -> bool

Whether any container currently has an active animation requiring vsync frames.
Source§

fn px_per_line(&self) -> f32

Logical pixels per discrete mouse-wheel line detent.
Source§

fn cancel_node(&mut self, id: NodeId)

Cancels any active animation, drag, or overscroll state for node.
Source§

fn reconcile_node( &mut self, id: NodeId, new_pos: (f32, f32), max: (f32, f32), anchor_delta: (f32, f32), explicit_seek: bool, )

Reconciles active physics bounds/offsets across layout commits without killing active momentum unless explicit_seek is true.
Source§

fn prune_missing(&mut self, store: &NodeStore)

Prunes state for nodes that are no longer live Scroll containers in store.
Source§

fn clear(&mut self)

Clears all internal physics and gesture state (called on crate::LaidOutScene::reset).
Source§

fn set_reduced_motion( &mut self, reduced: bool, scroll: &mut ScrollOffsets, out_visual: &mut Vec<NodeId>, out_clamped: &mut Vec<NodeId>, ) -> bool

Updates reduced-motion mode. When reduced is true, engines snap active smooth-wheel animations to their targets, updating scroll and pushing snapped nodes into out_visual/out_clamped. Returns true if any node snapped.
Source§

fn set_synthetic_momentum(&mut self, enabled: bool)

Controls whether phased trackpad/touch releases spawn synthetic momentum (false on macOS by default because AppKit delivers native OS momentum via PixelDelta).

Auto Trait Implementations§

§

impl<B> Forget for PooledScrollPhysics<B>

§

impl<B> Freeze for PooledScrollPhysics<B>
where B: Freeze,

§

impl<B> Move for PooledScrollPhysics<B>

§

impl<B> RefUnwindSafe for PooledScrollPhysics<B>
where B: RefUnwindSafe,

§

impl<B> Send for PooledScrollPhysics<B>

§

impl<B> Sync for PooledScrollPhysics<B>
where B: Sync,

§

impl<B> Unpin for PooledScrollPhysics<B>
where B: Unpin,

§

impl<B> UnsafeUnpin for PooledScrollPhysics<B>
where B: UnsafeUnpin,

§

impl<B> UnwindSafe for PooledScrollPhysics<B>
where B: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.