pub struct ScrollState<T> {
pub offset: T,
pub content_extent: T,
pub viewport_extent: T,
/* private fields */
}Expand description
persistent scroll position and motion
Fields§
§offset: Tscroll position which may temporarily be outside the scrollable range after a request
content_extent: T§viewport_extent: TImplementations§
Source§impl<T: Scalar> ScrollState<T>
impl<T: Scalar> ScrollState<T>
pub fn new() -> Self
pub fn maximum_offset(&self) -> T
pub fn scroll_by(&mut self, amount: T)
Sourcepub fn scroll_to(&mut self, offset: T)
pub fn scroll_to(&mut self, offset: T)
queues an offset resolved against the scroll area’s measured limits retargeting carries existing request velocity
Sourcepub fn reveal(&mut self, target: Id)
pub fn reveal(&mut self, target: Id)
queues a node of the scroll content to reveal within the viewport
pub fn stop(&mut self)
pub fn is_moving(&self) -> bool
Trait Implementations§
Source§impl<T: Debug> Debug for ScrollState<T>
impl<T: Debug> Debug for ScrollState<T>
Auto Trait Implementations§
impl<T> Forget for ScrollState<T>
impl<T> Freeze for ScrollState<T>
impl<T> Move for ScrollState<T>
impl<T> RefUnwindSafe for ScrollState<T>
impl<T> Send for ScrollState<T>
impl<T> Sync for ScrollState<T>
impl<T> Unpin for ScrollState<T>
impl<T> UnsafeUnpin for ScrollState<T>where
T: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
impl<T> UnwindSafe for ScrollState<T>
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