From da6bc6bdbf50da0eeeb4b544395c1b392d228d21 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Tue, 24 Nov 2026 19:20:10 -0700 Subject: switch to Send mutices; make the i3 protocol work that was a lot of painful debugging, but not much code in the end Force-Push: yes Change-Id: Ib38842ac3dafb4ab71ee041d0425accee1e9f067 --- src/facility.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/facility.rs') diff --git a/src/facility.rs b/src/facility.rs index 56afaf4..182b6bb 100644 --- a/src/facility.rs +++ b/src/facility.rs @@ -3,6 +3,7 @@ use crate::error::Result; use std::any::Any; use std::collections::BTreeMap; +use async_executor::StaticExecutor; use bitflags::bitflags; pub use envsys::EnvSys; @@ -55,7 +56,7 @@ pub trait CreatableFacility: Facility + Sized { * As far as why the compiler can't reach that conclusion on its own and * skip it, we have no specific information. */ - async fn new() -> Result; + async fn new(executor: &'static StaticExecutor) -> Result; /* The only way to coerce to dyn is to return as it! */ fn as_box<'a>(self) -> Box @@ -76,10 +77,12 @@ bitflags! { } impl FacilityType { - pub async fn new(&self) -> Result> { + pub async fn new(&self, executor: &'static StaticExecutor) + -> Result> + { match self { - &FacilityType::ENVSYS => Ok(EnvSys::new().await?.as_box()), - &FacilityType::I3 => Ok(I3::new().await?.as_box()), + &FacilityType::ENVSYS => Ok(EnvSys::new(executor).await?.as_box()), + &FacilityType::I3 => Ok(I3::new(executor).await?.as_box()), _ => todo!() } } -- cgit 1.4.1