pub struct AnimatedScrollState {
pub current_offset: LogicalPosition,
pub previous_offset: LogicalPosition,
pub animation: Option<ScrollAnimation>,
pub last_activity: Instant,
pub container_rect: LogicalRect,
pub content_rect: LogicalRect,
}Expand description
The complete scroll state for a single node (with animation support)
Fields§
§current_offset: LogicalPositionCurrent scroll offset (live, may be animating)
previous_offset: LogicalPositionPrevious frame’s scroll offset (for delta calculation)
animation: Option<ScrollAnimation>Ongoing smooth scroll animation, if any
last_activity: InstantLast time scroll activity occurred (for fading scrollbars)
container_rect: LogicalRectBounds of the scrollable container
content_rect: LogicalRectBounds of the total content (for calculating scroll limits)
Implementations§
Source§impl AnimatedScrollState
impl AnimatedScrollState
Sourcepub fn clamp(&self, position: LogicalPosition) -> LogicalPosition
pub fn clamp(&self, position: LogicalPosition) -> LogicalPosition
Clamp a scroll position to valid bounds (0 to max_scroll).
Trait Implementations§
Source§impl Clone for AnimatedScrollState
impl Clone for AnimatedScrollState
Source§fn clone(&self) -> AnimatedScrollState
fn clone(&self) -> AnimatedScrollState
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 moreAuto Trait Implementations§
impl Freeze for AnimatedScrollState
impl RefUnwindSafe for AnimatedScrollState
impl Send for AnimatedScrollState
impl Sync for AnimatedScrollState
impl Unpin for AnimatedScrollState
impl UnwindSafe for AnimatedScrollState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more