diff --git a/src/launcher.rs b/src/launcher.rs index af3640b..77a1ddb 100644 --- a/src/launcher.rs +++ b/src/launcher.rs @@ -12,9 +12,9 @@ pub mod batcher; pub struct Launcher where - UIT: UI, + UIT: UI, UIContext: Send, - Cushion: Sync + Send, + Cushion: Sync + Send + 'static, { batcher: Batcher, @@ -24,7 +24,7 @@ where impl Default for Launcher where - UIT: UI, + UIT: UI, UIContext: Send, Cushion: Sync + Send, { @@ -51,7 +51,7 @@ where /// as the transformer function impl Launcher where - UIT: UI, + UIT: UI, UIContext: Send, Cushion: Send + Sync + 'static, { diff --git a/src/ui.rs b/src/ui.rs index aa3a4f5..2cddeba 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -1,9 +1,9 @@ use color_eyre::Result; -pub trait UI { +pub trait UI { type Context; - fn run( + fn run( &self, batcher: crate::launcher::batcher::Batcher, ) -> impl std::future::Future>> + Send; diff --git a/tests/dummyui.rs b/tests/dummyui.rs index 605d533..0d90147 100644 --- a/tests/dummyui.rs +++ b/tests/dummyui.rs @@ -29,17 +29,15 @@ where } } -impl UI for DummyUI +impl UI for DummyUI where T: Sync + Send, F: Fn(&T) + Sync, + Cushion: Send + Sync + 'static, { type Context = T; - async fn run( - &self, - mut batcher: Batcher, - ) -> Result> { + async fn run(&self, mut batcher: Batcher) -> Result> { let mut more = true; let mut buf: Buffer<(T, usize)> = Buffer::default();