pub struct ScrollState {
pub offset: usize,
pub total: usize,
pub viewport: usize,
pub sticky: StickyScroll,
}Fields§
§offset: usize§total: usize§viewport: usize§sticky: StickyScrollImplementations§
Source§impl ScrollState
impl ScrollState
pub fn new() -> Self
pub fn with_sticky(self, sticky: StickyScroll) -> Self
pub fn set_bounds(&mut self, total: usize, viewport: usize)
pub fn max_offset(&self) -> usize
pub fn clamp(&mut self)
pub fn scroll_up(&mut self, lines: usize)
pub fn scroll_down(&mut self, lines: usize)
pub fn page_up(&mut self)
pub fn page_down(&mut self)
pub fn scroll_to_top(&mut self)
pub fn scroll_to_bottom(&mut self)
pub fn is_at_top(&self) -> bool
pub fn is_at_bottom(&self) -> bool
pub fn visible_range(&self) -> Range<usize>
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy 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
Source§fn eq(&self, other: &ScrollState) -> bool
fn eq(&self, other: &ScrollState) -> bool
Tests for
self and other values to be equal, and is used by ==.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