feat(config): add structure
chore(deps): add serde+derive and toml
This commit is contained in:
parent
02c9af6574
commit
8db3ab3c12
|
@ -16,7 +16,8 @@ name = "hwt"
|
|||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
druid = "0.7.0"
|
||||
|
||||
log = "0.4.14"
|
||||
druid = "0.7.0"
|
||||
rodio = "0.15.0"
|
||||
serde = { version = "1.0.136", features = ["derive"] }
|
||||
toml = "0.5.8"
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct Env {
|
||||
pub micro_timer: BreakTimer,
|
||||
pub rest_timer: BreakTimer,
|
||||
pub notifier: Notifier,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct BreakTimer {
|
||||
pub duration: f64,
|
||||
pub postpone_duration: f64,
|
||||
pub rest_duration: f64,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct Notifier {
|
||||
pub duration: f64,
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
mod cmd;
|
||||
mod comp;
|
||||
mod config;
|
||||
mod delegate;
|
||||
mod env;
|
||||
mod sound;
|
||||
|
|
Loading…
Reference in New Issue