pub struct ScrollViewState { /* private fields */ }Implementations§
Source§impl ScrollViewState
impl ScrollViewState
Sourcepub fn with_offset(offset: Position) -> Self
pub fn with_offset(offset: Position) -> Self
Create a new scroll view state with the given offset
Sourcepub const fn set_offset(&mut self, offset: Position)
pub const fn set_offset(&mut self, offset: Position)
Set the offset of the scroll view state
Sourcepub const fn scroll_down(&mut self)
pub const fn scroll_down(&mut self)
Move the scroll view state down by one row
Sourcepub fn scroll_page_down(&mut self)
pub fn scroll_page_down(&mut self)
Move the scroll view state down by one page
Sourcepub fn scroll_page_up(&mut self)
pub fn scroll_page_up(&mut self)
Move the scroll view state up by one page
Sourcepub const fn scroll_left(&mut self)
pub const fn scroll_left(&mut self)
Move the scroll view state left by one column
Sourcepub const fn scroll_right(&mut self)
pub const fn scroll_right(&mut self)
Move the scroll view state right by one column
Sourcepub const fn scroll_to_top(&mut self)
pub const fn scroll_to_top(&mut self)
Move the scroll view state to the top of the buffer
Sourcepub fn scroll_to_bottom(&mut self)
pub fn scroll_to_bottom(&mut self)
Move the scroll view state to the bottom of the buffer
If the buffer size is not yet computed (done during the first rendering), it will not
be taken into account and the scroll offset will be set to the maximum value: u16::MAX
Sourcepub fn is_at_bottom(&self) -> bool
pub fn is_at_bottom(&self) -> bool
True if the scroll view state is at the bottom of the buffer
This takes the page size into account. It returns true if the last row in the buffer is visible in the current page.
The buffer and the page size are unknown until computed during the first rendering. If the buffer size is not yet known, this function always returns true. If the page size is not yet known, the current row is treated as a one-row page.
Saturating arithmetic prevents large offsets from overflowing when they are combined with the page size.
Trait Implementations§
Source§impl Clone for ScrollViewState
impl Clone for ScrollViewState
Source§fn clone(&self) -> ScrollViewState
fn clone(&self) -> ScrollViewState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ScrollViewState
Source§impl Debug for ScrollViewState
impl Debug for ScrollViewState
Source§impl Default for ScrollViewState
impl Default for ScrollViewState
Source§fn default() -> ScrollViewState
fn default() -> ScrollViewState
impl Eq for ScrollViewState
Source§impl Hash for ScrollViewState
impl Hash for ScrollViewState
Source§impl PartialEq for ScrollViewState
impl PartialEq for ScrollViewState
Source§fn eq(&self, other: &ScrollViewState) -> bool
fn eq(&self, other: &ScrollViewState) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ScrollViewState
Auto Trait Implementations§
impl Freeze for ScrollViewState
impl RefUnwindSafe for ScrollViewState
impl Send for ScrollViewState
impl Sync for ScrollViewState
impl Unpin for ScrollViewState
impl UnsafeUnpin for ScrollViewState
impl UnwindSafe for ScrollViewState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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