pub struct Scrollbar { /* private fields */ }Expand description
Immutable semantic input for one finite-viewport position indicator.
Lengths and positions use caller-defined content units. They may be rows,
columns, items, or another uniform unit, provided all three values use the
same unit. Rendering clamps position to the last origin at which the
viewport remains within the content.
Implementations§
Source§impl Scrollbar
impl Scrollbar
Sourcepub const fn new(
orientation: ScrollbarOrientation,
content_length: usize,
viewport_length: usize,
) -> Self
pub const fn new( orientation: ScrollbarOrientation, content_length: usize, viewport_length: usize, ) -> Self
Creates a scrollbar at the beginning of its content.
Sourcepub const fn position(self, position: usize) -> Self
pub const fn position(self, position: usize) -> Self
Replaces the requested viewport origin.
The presentation clamps an out-of-range value after accounting for the current content and viewport lengths.
pub const fn orientation(&self) -> ScrollbarOrientation
pub const fn content_length(&self) -> usize
pub const fn viewport_length(&self) -> usize
pub const fn get_position(&self) -> usize
Trait Implementations§
impl Copy for Scrollbar
impl Eq for Scrollbar
impl StructuralPartialEq for Scrollbar
Auto Trait Implementations§
impl Freeze for Scrollbar
impl RefUnwindSafe for Scrollbar
impl Send for Scrollbar
impl Sync for Scrollbar
impl Unpin for Scrollbar
impl UnsafeUnpin for Scrollbar
impl UnwindSafe for Scrollbar
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