#[non_exhaustive]pub enum Control<Message> {
Continue,
Unchanged,
Changed,
Message(Message),
Quit,
}Expand description
Result enum for event handling.
The result of an event is processed immediately after the function returns, before polling new events. This way an action can trigger another action which triggers the repaint without other events intervening.
If you ever need to return more than one result from event-handling, you can hand it to AppContext/RenderContext::queue(). Events in the queue are processed in order, and the return value of the event-handler comes last. If an error is returned, everything send to the queue will be executed nonetheless.
See
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Continue
Continue with event-handling. In the event-loop this waits for the next event.
Unchanged
Break event-handling without repaint. In the event-loop this waits for the next event.
Changed
Break event-handling and repaints/renders the application.
In the event-loop this calls render.
Message(Message)
Handle an application defined event. This calls message
to distribute the message throughout the application.
This helps with interactions between parts of the application.
Quit
Quit the application.
Trait Implementations§
Source§impl<Message> ConsumedEvent for Control<Message>
impl<Message> ConsumedEvent for Control<Message>
Source§fn is_consumed(&self) -> bool
fn is_consumed(&self) -> bool
Source§fn or_else_try<F, E>(self, f: F) -> Result<Self, E>
fn or_else_try<F, E>(self, f: F) -> Result<Self, E>
is_consumed() as the split.Source§impl<Message> Ord for Control<Message>
impl<Message> Ord for Control<Message>
Source§impl<Message> PartialOrd for Control<Message>
impl<Message> PartialOrd for Control<Message>
impl<Message: Copy> Copy for Control<Message>
impl<Message> Eq for Control<Message>
Auto Trait Implementations§
impl<Message> Freeze for Control<Message>where
Message: Freeze,
impl<Message> RefUnwindSafe for Control<Message>where
Message: RefUnwindSafe,
impl<Message> Send for Control<Message>where
Message: Send,
impl<Message> Sync for Control<Message>where
Message: Sync,
impl<Message> Unpin for Control<Message>where
Message: Unpin,
impl<Message> UnwindSafe for Control<Message>where
Message: 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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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