pub struct ScrollHandle { /* private fields */ }Expand description
A lightweight imperative handle for driving scroll state.
This is intentionally small and allocation-free to clone, so component-layer code can store it and pass it back into declarative elements each frame.
Implementations§
Source§impl ScrollHandle
impl ScrollHandle
pub fn offset(&self) -> Point
Sourcepub fn revision(&self) -> u64
pub fn revision(&self) -> u64
Monotonic revision counter that increments when the scroll offset changes via
ScrollHandle::set_offset (or helpers that call it).
The declarative runtime uses this to detect out-of-band scroll changes (e.g. component-driven “scroll into view”) and invalidate the bound scroll nodes, even when the element instances themselves did not change.
pub fn max_offset(&self) -> Point
pub fn clamp_offset(&self, offset: Point) -> Point
pub fn set_offset(&self, offset: Point)
pub fn scroll_to_offset(&self, offset: Point)
pub fn viewport_size(&self) -> Size
pub fn set_viewport_size(&self, viewport: Size)
pub fn content_size(&self) -> Size
pub fn set_content_size(&self, content: Size)
pub fn scroll_to_range_y( &self, start_y: Px, end_y: Px, strategy: ScrollStrategy, )
Trait Implementations§
Source§impl Clone for ScrollHandle
impl Clone for ScrollHandle
Source§fn clone(&self) -> ScrollHandle
fn clone(&self) -> ScrollHandle
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 ScrollHandle
impl Debug for ScrollHandle
Source§impl Default for ScrollHandle
impl Default for ScrollHandle
Source§fn default() -> ScrollHandle
fn default() -> ScrollHandle
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ScrollHandle
impl !RefUnwindSafe for ScrollHandle
impl !Send for ScrollHandle
impl !Sync for ScrollHandle
impl Unpin for ScrollHandle
impl UnsafeUnpin for ScrollHandle
impl !UnwindSafe for ScrollHandle
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