Skip to content

Commit

Permalink
feat: add Event::event_type
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigodd committed Sep 1, 2024
1 parent 78027b3 commit cb44ab4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions types/src/utils/event.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use crate::{Event, EventType};

impl Event {
pub fn event_type(&self) -> EventType {
match self {
Event::Workspace(_) => EventType::Workspace,
Event::Mode(_) => EventType::Mode,
Event::Window(_) => EventType::Window,
Event::BarConfigUpdate(_) => EventType::BarConfigUpdate,
Event::Binding(_) => EventType::Binding,
Event::Shutdown(_) => EventType::Shutdown,
Event::Tick(_) => EventType::Tick,
Event::BarStateUpdate(_) => EventType::BarStateUpdate,
Event::Input(_) => EventType::Input,
Event::Output(_) => EventType::Output,
}
}
}
1 change: 1 addition & 0 deletions types/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mod event;
mod node;

0 comments on commit cb44ab4

Please sign in to comment.