Struct rat_widget::scrolled::ViewState

source ·
pub struct ViewState {
    pub area: Rect,
    pub view_area: Rect,
    pub h_offset: usize,
    pub v_offset: usize,
    pub non_exhaustive: NonExhaustive,
}
Expand description

State of the view.

Fields§

§area: Rect

The drawing area for the view.

§view_area: Rect

The view area that the inner widget sees.

§h_offset: usize

Horizontal offset

§v_offset: usize

Vertical offset

§non_exhaustive: NonExhaustive

Only construct with ..Default::default().

Trait Implementations§

source§

impl Clone for ViewState

source§

fn clone(&self) -> ViewState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ViewState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for ViewState

source§

fn default() -> ViewState

Returns the “default value” for a type. Read more
source§

impl<R> HandleEvent<Event, FocusKeys, ScrollOutcome<R>> for ViewState
where R: ConsumedEvent,

Handle all events. Text events are only processed if focus is true. Mouse events are processed if they are in range.

source§

fn handle(&mut self, _event: &Event, _keymap: FocusKeys) -> ScrollOutcome<R>

Handle an event. Read more
source§

impl<R> HandleEvent<Event, MouseOnly, ScrollOutcome<R>> for ViewState
where R: ConsumedEvent,

Handle only mouse-events.

source§

fn handle(&mut self, _event: &Event, _keymap: MouseOnly) -> ScrollOutcome<R>

Handle an event. Read more
source§

impl ScrollingState for ViewState

source§

fn vertical_max_offset(&self) -> usize

Maximum offset that is accessible with scrolling. Read more
source§

fn vertical_offset(&self) -> usize

Current vertical offset.
source§

fn vertical_page(&self) -> usize

Vertical page-size at the current offset.
source§

fn horizontal_max_offset(&self) -> usize

Maximum offset that is accessible with scrolling. Read more
source§

fn horizontal_offset(&self) -> usize

Current horizontal offset.
source§

fn horizontal_page(&self) -> usize

Horizontal page-size at the current offset.
source§

fn set_vertical_offset(&mut self, offset: usize) -> bool

Change the vertical offset. Read more
source§

fn set_horizontal_offset(&mut self, offset: usize) -> bool

Change the horizontal offset. Read more
source§

fn vertical_scroll(&self) -> usize

Suggested scroll per scroll-event.
source§

fn horizontal_scroll(&self) -> usize

Suggested scroll per scroll-event.
source§

fn scroll_up(&mut self, n: usize) -> bool

Scroll up by n items. The widget returns true if the offset changed at all.
source§

fn scroll_down(&mut self, n: usize) -> bool

Scroll down by n items. The widget returns true if the offset changed at all.
source§

fn scroll_left(&mut self, n: usize) -> bool

Scroll up by n items. The widget returns true if the offset changed at all.
source§

fn scroll_right(&mut self, n: usize) -> bool

Scroll down by n items. The widget returns true if the offset changed at all.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.