diff options
Diffstat (limited to 'src/module.rs')
| -rw-r--r-- | src/module.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/module.rs b/src/module.rs index a716fa7..8d5264f 100644 --- a/src/module.rs +++ b/src/module.rs @@ -3,6 +3,7 @@ use crate::facility::{ FacilityMap, FacilityType }; use std::time::Duration; +use async_channel::Sender; use async_executor::StaticExecutor; @@ -21,7 +22,9 @@ pub mod time; pub trait CreatableModule: Module + Sized { const REQUIRED_FACILITIES: FacilityType; - async fn new(facilities: &mut FacilityMap, executor: &'static StaticExecutor) + async fn new(facilities: &mut FacilityMap, + executor: &'static StaticExecutor, + redraw_sender: Sender<()>) -> Result<Self>; /* The only way to coerce to dyn is to return as it! */ @@ -33,6 +36,9 @@ pub trait CreatableModule: Module + Sized { } pub trait Module { + /* While it would be nice to make this all async, that wouldn't be + * dyn-compatible. + */ fn format(&mut self, facilities: &mut FacilityMap) -> Result<String>; fn sleep_duration(&self) -> Option<Duration>; fn is_visible(&self) -> bool; |