swayipc_types/utils/
event.rs1use crate::{Event, EventType};
2
3impl Event {
4 pub fn event_type(&self) -> EventType {
5 match self {
6 Event::Workspace(_) => EventType::Workspace,
7 Event::Mode(_) => EventType::Mode,
8 Event::Window(_) => EventType::Window,
9 Event::BarConfigUpdate(_) => EventType::BarConfigUpdate,
10 Event::Binding(_) => EventType::Binding,
11 Event::Shutdown(_) => EventType::Shutdown,
12 Event::Tick(_) => EventType::Tick,
13 Event::BarStateUpdate(_) => EventType::BarStateUpdate,
14 Event::Input(_) => EventType::Input,
15 Event::Output(_) => EventType::Output,
16 }
17 }
18}