pub enum EventResult {
Handled,
Consumed,
NotHandled,
}Expand description
Result of handling an event.
Unlike Result<T, E>, this enum has no error variant. Event handling follows
a fire-and-forget philosophy where handlers must not fail - they either
handle the event or pass it on.
§Handler Behavior
Handled: Continue to next handler (most common)Consumed: Stop propagation to remaining handlersNotHandled: Handler didn’t process this event (continue dispatch)
Variants§
Handled
Event was handled, continue to next handler.
Consumed
Event was consumed, stop propagation.
NotHandled
Handler did not process this event.
Implementations§
Source§impl EventResult
impl EventResult
Sourcepub const fn is_consumed(&self) -> bool
pub const fn is_consumed(&self) -> bool
Returns true if the event was consumed (propagation should stop).
Sourcepub const fn is_handled(&self) -> bool
pub const fn is_handled(&self) -> bool
Returns true if the event was handled (but not consumed).
Sourcepub const fn is_not_handled(&self) -> bool
pub const fn is_not_handled(&self) -> bool
Returns true if the handler did not process the event.
Trait Implementations§
Source§impl Clone for EventResult
impl Clone for EventResult
Source§fn clone(&self) -> EventResult
fn clone(&self) -> EventResult
Returns a duplicate 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 Debug for EventResult
impl Debug for EventResult
Source§impl Default for EventResult
impl Default for EventResult
Source§fn default() -> EventResult
fn default() -> EventResult
Returns the “default value” for a type. Read more
Source§impl PartialEq for EventResult
impl PartialEq for EventResult
impl Copy for EventResult
impl Eq for EventResult
impl StructuralPartialEq for EventResult
Auto Trait Implementations§
impl Freeze for EventResult
impl RefUnwindSafe for EventResult
impl Send for EventResult
impl Sync for EventResult
impl Unpin for EventResult
impl UnsafeUnpin for EventResult
impl UnwindSafe for EventResult
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