pub struct ScrollState {
pub index: Option<usize>,
pub align: ScrollAlignment,
pub behavior: ScrollBehavior,
pub started_at: f64,
pub last_target_offset: f64,
pub stable_frames: u32,
}Expand description
Internal state for an active programmatic scroll operation.
Tracks the target, alignment, behavior, and settling progress of an in-flight scroll reconciliation loop. Used by the virtualizer to determine when a smooth scroll has reached its destination.
Fields§
§index: Option<usize>The target item index, if scrolling to a specific item.
align: ScrollAlignmentThe alignment used for this scroll operation.
behavior: ScrollBehaviorThe animation behavior for the scroll.
started_at: f64Timestamp (ms) when this scroll operation started.
last_target_offset: f64The last computed target scroll offset.
stable_frames: u32Number of consecutive frames where the scroll position matched the target (used for settling detection).
Implementations§
Source§impl ScrollState
impl ScrollState
Sourcepub fn new(
index: Option<usize>,
align: ScrollAlignment,
behavior: ScrollBehavior,
started_at: f64,
last_target_offset: f64,
) -> Self
pub fn new( index: Option<usize>, align: ScrollAlignment, behavior: ScrollBehavior, started_at: f64, last_target_offset: f64, ) -> Self
Creates a new scroll state for a programmatic scroll operation.
§Parameters
index: Optional target item index.align: The alignment for the scroll.behavior: The animation behavior.started_at: Timestamp when the scroll started.last_target_offset: The initial target scroll offset.
Trait Implementations§
Source§impl Clone for ScrollState
impl Clone for ScrollState
Source§fn clone(&self) -> ScrollState
fn clone(&self) -> ScrollState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScrollState
impl Debug for ScrollState
Source§impl PartialEq for ScrollState
impl PartialEq for ScrollState
impl StructuralPartialEq for ScrollState
Auto Trait Implementations§
impl Freeze for ScrollState
impl RefUnwindSafe for ScrollState
impl Send for ScrollState
impl Sync for ScrollState
impl Unpin for ScrollState
impl UnsafeUnpin for ScrollState
impl UnwindSafe for ScrollState
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