diff options
| author | RanXom <saiyedshizain@gmail.com> | 2026-06-13 15:38:50 +0530 |
|---|---|---|
| committer | RanXom <saiyedshizain@gmail.com> | 2026-06-13 15:38:50 +0530 |
| commit | 8db291b6d772fe521ca0fba95a832cb49a6ae14d (patch) | |
| tree | 7127bda24564b45411c0095700b0d7c670b76562 /crates | |
| parent | 835a62d566d9bd836a0668712ec9180b5e8f393c (diff) | |
| download | pomoru-8db291b6d772fe521ca0fba95a832cb49a6ae14d.tar.xz pomoru-8db291b6d772fe521ca0fba95a832cb49a6ae14d.zip | |
create lib.rs and sessions info for status
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/pomoru-core/src/lib.rs | 6 | ||||
| -rw-r--r-- | crates/pomoru-core/src/session.rs | 43 |
2 files changed, 49 insertions, 0 deletions
diff --git a/crates/pomoru-core/src/lib.rs b/crates/pomoru-core/src/lib.rs new file mode 100644 index 0000000..f9763ac --- /dev/null +++ b/crates/pomoru-core/src/lib.rs @@ -0,0 +1,6 @@ +pub mod config; +pub mod notification; +pub mod session; +pub mod status; +pub mod task; +pub mod timer;
\ No newline at end of file diff --git a/crates/pomoru-core/src/session.rs b/crates/pomoru-core/src/session.rs new file mode 100644 index 0000000..1f54e2f --- /dev/null +++ b/crates/pomoru-core/src/session.rs @@ -0,0 +1,43 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "kebab-case")] +pub enum SessionMode { + Work, + ShortBreak, + LongBreak, +} + +impl SessionMode { + pub fn label(self) -> &'static str { + match self { + SessionMode::Work => "Work", + SessionMode::ShortBreak => "Short Break", + SessionMode::LongBreak => "Long Break", + } + } + + pub fn class(self) -> &'static str { + match self { + SessionMode::Work => "work", + SessionMode::ShortBreak => "short-break", + SessionMode::LongBreak => "long-break", + } + } + + pub fn icon(self) -> &'static str { + match self { + SessionMode::Work => "", + SessionMode::ShortBreak => "", + SessionMode::LongBreak => "", + } + } + + pub fn next(self) -> SessionMode { + match self { + SessionMode::Work => SessionMode::ShortBreak, + SessionMode::ShortBreak => SessionMode::LongBreak, + SessionMode::LongBreak => SessionMode::Work, + } + } +} |