Trait rat_widget::event::ConsumedEvent
source · pub trait ConsumedEvent {
// Required method
fn is_consumed(&self) -> bool;
// Provided method
fn or_else<F>(self, f: F) -> Self
where F: FnOnce() -> Self,
Self: Sized { ... }
}Expand description
When composing several widgets, the minimum information from the outcome of the inner widget is, whether it used & consumed the event.
This allows shortcutting the event-handling and prevents double interactions with the event. The inner widget can special case an event, and the fallback behaviour on the outer layer should not run too.