Struct rat_widget::view::ViewState
source · pub struct ViewState {
pub area: Rect,
pub inner_area: Rect,
pub view_area: Rect,
pub hscroll: ScrollState,
pub vscroll: ScrollState,
pub non_exhaustive: NonExhaustive,
}Expand description
State of the viewport.
Fields§
§area: RectComplete area of the viewport.
inner_area: RectInner area of the viewport.
view_area: RectThe viewport area that the inner widget sees.
hscroll: ScrollStateHorizontal scroll
vscroll: ScrollStateVertical scroll
non_exhaustive: NonExhaustiveOnly construct with ..Default::default().
Implementations§
source§impl ViewState
impl ViewState
pub fn new() -> Self
pub fn vertical_offset(&self) -> usize
pub fn set_vertical_offset(&mut self, offset: usize) -> bool
pub fn vertical_page_len(&self) -> usize
pub fn horizontal_offset(&self) -> usize
pub fn set_horizontal_offset(&mut self, offset: usize) -> bool
pub fn horizontal_page_len(&self) -> usize
pub fn horizontal_scroll_to(&mut self, pos: usize) -> bool
pub fn vertical_scroll_to(&mut self, pos: usize) -> bool
pub fn scroll_up(&mut self, delta: usize) -> bool
pub fn scroll_down(&mut self, delta: usize) -> bool
pub fn scroll_left(&mut self, delta: usize) -> bool
pub fn scroll_right(&mut self, delta: usize) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ViewState
impl !RefUnwindSafe for ViewState
impl Send for ViewState
impl !Sync for ViewState
impl Unpin for ViewState
impl UnwindSafe for ViewState
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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>
Converts
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>
Converts
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