pub struct ScrollState { /* private fields */ }Expand description
The scroll position of a ScrollColumn or ScrollRow, and a handle to move it.
The Renderer owns the scroll physics and the scrollbar; this handle reads the current offset and maximum offset in dp as observable states and sends target scroll requests.
Implementations§
Source§impl ScrollState
impl ScrollState
Sourcepub fn offset(&self) -> f32
pub fn offset(&self) -> f32
The current scroll offset in dp. A composable that reads this runs again when the user or a programmatic scroll moves the container.
Sourcepub fn max_offset(&self) -> f32
pub fn max_offset(&self) -> f32
The furthest offset in dp the container can scroll to (0.0 when the content fits
inside the viewport). A composable that reads this runs again when the content or
viewport size changes the scrollable distance.
Sourcepub fn animate_scroll_to(&self, dp: f32)
pub fn animate_scroll_to(&self, dp: f32)
Smoothly scrolls to dp (clamped by the Renderer to 0.0..=max_offset).
Trait Implementations§
Source§impl Clone for ScrollState
impl Clone for ScrollState
Source§impl Debug for ScrollState
impl Debug for ScrollState
Source§impl Default for ScrollState
impl Default for ScrollState
impl Eq for ScrollState
Source§impl PartialEq for ScrollState
impl PartialEq for ScrollState
impl StructuralPartialEq for ScrollState
Auto Trait Implementations§
impl Forget for ScrollState
impl Freeze for ScrollState
impl Move 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