about summary refs log tree commit diff
path: root/src/module.rs
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-11-25 03:40:14 -0700
committerIrene Knapp <ireneista@irenes.space>2026-11-25 04:16:31 -0700
commitb65303ede0750e9d83df4d2c5df67f143c9171c4 (patch)
treea8d15bdaa3493ed7a8b66092e6f58cf6ebe1909f /src/module.rs
parent5ec7ae026ce9d8c48ef5f0590a300fa308efa487 (diff)
i3 mode module fully works now; some API changes
most notably, modules now have a way to request immediate redrawing

Change-Id: Id060c88d3ab484addfd8ca574fbc4e2ffdbb5c8f
Force-Push: yes
Diffstat (limited to 'src/module.rs')
-rw-r--r--src/module.rs8
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;