diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-11-18 14:12:11 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-11-18 14:12:11 -0700 |
| commit | ddc986ea05c5c17758e1028ce0d9f20dc133ec9d (patch) | |
| tree | 417111926032329d71ce8a292c151b04fffa7201 /src/modules.rs | |
| parent | 01f5b773ab89b809059e2212feb8547f8b073e91 (diff) | |
add an abstraction called "facilities", which does nothing yet
the type system work was a pain, so it's being checked in now Force-Push: yes Change-Id: If7ec15f0108afb030fa2e5a207c77a6cf9828c43
Diffstat (limited to 'src/modules.rs')
| -rw-r--r-- | src/modules.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modules.rs b/src/modules.rs index 0aeda34..e28ac41 100644 --- a/src/modules.rs +++ b/src/modules.rs @@ -1,4 +1,20 @@ +use crate::error::Result; +use crate::facilities::FacilityType; + +use std::sync::{ Arc, Mutex }; +use std::time::Duration; + + pub use time::TimeModule; pub mod time; + +pub trait Module { + const REQUIRED_FACILITIES: FacilityType; + + fn new() -> Result<Arc<Mutex<Self>>>; + fn format(&mut self) -> String; + fn sleep_duration(&self) -> Option<Duration>; +} + |