diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-11-24 19:20:10 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-11-24 19:20:10 -0700 |
| commit | da6bc6bdbf50da0eeeb4b544395c1b392d228d21 (patch) | |
| tree | 94413c03855cd94b7f6955a1bcaab8d7141b06b1 /src/facility.rs | |
| parent | 7465b56cc11bb4b17ba8d994142da0b74cbb8c7e (diff) | |
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
Diffstat (limited to 'src/facility.rs')
| -rw-r--r-- | src/facility.rs | 11 |
1 files changed, 7 insertions, 4 deletions
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<Self>; + async fn new(executor: &'static StaticExecutor) -> Result<Self>; /* The only way to coerce to dyn is to return as it! */ fn as_box<'a>(self) -> Box<dyn Facility + 'a> @@ -76,10 +77,12 @@ bitflags! { } impl FacilityType { - pub async fn new(&self) -> Result<Box<dyn Facility>> { + pub async fn new(&self, executor: &'static StaticExecutor) + -> Result<Box<dyn Facility>> + { 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!() } } |