Struct rat_widget::viewport::ViewportState
source · pub struct ViewportState<S> {
pub widget: S,
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§
§widget: S§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<S> ViewportState<S>
impl<S> ViewportState<S>
sourcepub fn relocate_crossterm(&self, event: &Event) -> Event
pub fn relocate_crossterm(&self, event: &Event) -> Event
Relocate mouse-events for use inside the viewport.
source§impl<S> ViewportState<S>
impl<S> ViewportState<S>
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§
source§impl<S: Clone> Clone for ViewportState<S>
impl<S: Clone> Clone for ViewportState<S>
source§fn clone(&self) -> ViewportState<S>
fn clone(&self) -> ViewportState<S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<S: Debug> Debug for ViewportState<S>
impl<S: Debug> Debug for ViewportState<S>
source§impl<S: Default> Default for ViewportState<S>
impl<S: Default> Default for ViewportState<S>
source§impl<R, Q, S> HandleEvent<Event, Q, R> for ViewportState<S>
impl<R, Q, S> HandleEvent<Event, Q, R> for ViewportState<S>
Auto Trait Implementations§
impl<S> !Freeze for ViewportState<S>
impl<S> !RefUnwindSafe for ViewportState<S>
impl<S> Send for ViewportState<S>where
S: Send,
impl<S> !Sync for ViewportState<S>
impl<S> Unpin for ViewportState<S>where
S: Unpin,
impl<S> UnwindSafe for ViewportState<S>where
S: UnwindSafe,
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