Enum rat_widget::event::ScrollOutcome

source ·
pub enum ScrollOutcome<R> {
    NotUsed,
    Unchanged,
    Changed,
    Inner(R),
}
Expand description

Result value for event-handling. Used widgets in this crate.

Variants§

§

NotUsed

The given event was not handled at all.

§

Unchanged

The event was handled, no repaint necessary.

§

Changed

The event was handled, repaint necessary.

§

Inner(R)

Outcome of the inner widget.

Implementations§

source§

impl<R> ScrollOutcome<ScrollOutcome<R>>

source

pub fn flatten(self) -> ScrollOutcome<R>

Compact two layers of Outcome to one.

source§

impl<R> ScrollOutcome<ScrollOutcome<ScrollOutcome<R>>>

source

pub fn flatten2(self) -> ScrollOutcome<R>

Compact three layers of Outcome to one.

Trait Implementations§

source§

impl<R> Clone for ScrollOutcome<R>
where R: Clone,

source§

fn clone(&self) -> ScrollOutcome<R>

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<R> ConsumedEvent for ScrollOutcome<R>
where R: ConsumedEvent,

source§

fn is_consumed(&self) -> bool

source§

fn or_else<F>(self, f: F) -> Self
where F: FnOnce() -> Self, Self: Sized,

Or-Else chaining with is_consumed() as the split.
source§

impl<R> Debug for ScrollOutcome<R>
where R: Debug,

source§

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

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

impl<T> From<ScrollOutcome<T>> for Outcome

source§

fn from(value: ScrollOutcome<T>) -> Outcome

Converts to this type from the input type.
source§

impl<R, WState> HandleEvent<Event, FocusKeys, ScrollOutcome<R>> for ScrolledState<WState>

Handle events or the scrolled widget and forward to the inner widget.

source§

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

Handle an event. 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, S> HandleEvent<Event, FocusKeys, ScrollOutcome<R>> for ViewportState<S>

Handle events if the widget has the focus.

source§

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

Handle an event. Read more
source§

impl<WState, Q, R> HandleEvent<Event, Inner<Q>, ScrollOutcome<R>> for ScrolledState<WState>
where WState: ScrollingState + HandleEvent<Event, Q, R>, R: ConsumedEvent,

Forward event-handling to the inner widget.

source§

fn handle(&mut self, event: &Event, qualifier: Inner<Q>) -> ScrollOutcome<R>

Handle an event. Read more
source§

impl<R, WState> HandleEvent<Event, MouseOnly, ScrollOutcome<R>> for ScrolledState<WState>

Handle events for the Scrolled widget and the scrollbars.

source§

fn handle(&mut self, event: &Event, _keymap: MouseOnly) -> 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<R, S> HandleEvent<Event, MouseOnly, ScrollOutcome<R>> for ViewportState<S>

Handle only mouse-events.

source§

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

Handle an event. Read more
source§

impl<R> PartialEq for ScrollOutcome<R>
where R: PartialEq,

source§

fn eq(&self, other: &ScrollOutcome<R>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<R> Copy for ScrollOutcome<R>
where R: Copy,

source§

impl<R> Eq for ScrollOutcome<R>
where R: Eq,

source§

impl<R> StructuralPartialEq for ScrollOutcome<R>

Auto Trait Implementations§

§

impl<R> Freeze for ScrollOutcome<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for ScrollOutcome<R>
where R: RefUnwindSafe,

§

impl<R> Send for ScrollOutcome<R>
where R: Send,

§

impl<R> Sync for ScrollOutcome<R>
where R: Sync,

§

impl<R> Unpin for ScrollOutcome<R>
where R: Unpin,

§

impl<R> UnwindSafe for ScrollOutcome<R>
where R: UnwindSafe,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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.