From b65303ede0750e9d83df4d2c5df67f143c9171c4 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Wed, 25 Nov 2026 03:40:14 -0700 Subject: 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 --- src/module.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/module.rs') 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; /* 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; fn sleep_duration(&self) -> Option; fn is_visible(&self) -> bool; -- cgit 1.4.1