#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EventResponse {
Handled,
Ignored,
StopPropagation,
Cancel,
StopAndCancel,
}
impl EventResponse {
pub fn is_handled(&self) -> bool {
!matches!(self, Self::Ignored)
}
pub fn should_stop(&self) -> bool {
matches!(self, Self::StopPropagation | Self::StopAndCancel)
}
pub fn should_cancel(&self) -> bool {
matches!(self, Self::Cancel | Self::StopAndCancel)
}
}