pub enum EventResult<Msg> {
Ignored,
Consumed,
Emit(Msg),
}Expand description
What a component did with an event, and what should happen next.
Events travel from a component up through its ancestors. This value decides
whether that continues: Ignored passes the event to the parent, while both
Consumed and Emit stop it there.
The same enum comes back out of
Ratcn::handle_event, so the app sees the
final outcome after bubbling has finished.
Variants§
Ignored
Not handled here. The parent gets a chance at it, and if nothing in the
chain handles it the app sees Ignored and can treat it as a global
hotkey.
Consumed
Handled, with nothing for the app to do — a keypress that only moved an internal cursor, for example.
Emit(Msg)
Handled, and the app should apply this message. Implies consumed.
Components never write app state themselves; this message is how a change reaches the app’s update function.
Trait Implementations§
Source§impl<Msg: Clone> Clone for EventResult<Msg>
impl<Msg: Clone> Clone for EventResult<Msg>
Source§fn clone(&self) -> EventResult<Msg>
fn clone(&self) -> EventResult<Msg>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Msg: Debug> Debug for EventResult<Msg>
impl<Msg: Debug> Debug for EventResult<Msg>
impl<Msg: Eq> Eq for EventResult<Msg>
Source§impl<Msg: PartialEq> PartialEq for EventResult<Msg>
impl<Msg: PartialEq> PartialEq for EventResult<Msg>
impl<Msg: PartialEq> StructuralPartialEq for EventResult<Msg>
Auto Trait Implementations§
impl<Msg> Freeze for EventResult<Msg>where
Msg: Freeze,
impl<Msg> RefUnwindSafe for EventResult<Msg>where
Msg: RefUnwindSafe,
impl<Msg> Send for EventResult<Msg>where
Msg: Send,
impl<Msg> Sync for EventResult<Msg>where
Msg: Sync,
impl<Msg> Unpin for EventResult<Msg>where
Msg: Unpin,
impl<Msg> UnsafeUnpin for EventResult<Msg>where
Msg: UnsafeUnpin,
impl<Msg> UnwindSafe for EventResult<Msg>where
Msg: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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