summaryrefslogtreecommitdiffstats
path: root/futures/src/executor.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-01-28 17:35:47 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-01-28 21:37:17 +0700
commit5dab5a327ef643ee38ac3e42ab35212fff445631 (patch)
treef3b9f2e64a538f250e4785677f7985bd11e4ed3b /futures/src/executor.rs
parent83c649b574d90667d23c8430baaebcd0ef933055 (diff)
downloadiced-5dab5a327ef643ee38ac3e42ab35212fff445631.tar.gz
iced-5dab5a327ef643ee38ac3e42ab35212fff445631.tar.bz2
iced-5dab5a327ef643ee38ac3e42ab35212fff445631.zip
Introduce `MaybeSend` trait in `iced_futures`
It allows to clean up all the `trait_aliases` modules!
Diffstat (limited to 'futures/src/executor.rs')
-rw-r--r--futures/src/executor.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/futures/src/executor.rs b/futures/src/executor.rs
index 23682f32..34e329a0 100644
--- a/futures/src/executor.rs
+++ b/futures/src/executor.rs
@@ -33,6 +33,7 @@ pub use self::smol::Smol;
#[cfg(target_arch = "wasm32")]
pub use wasm_bindgen::WasmBindgen;
+use crate::MaybeSend;
use futures::Future;
/// A type that can run futures.
@@ -43,12 +44,7 @@ pub trait Executor: Sized {
Self: Sized;
/// Spawns a future in the [`Executor`].
- #[cfg(not(target_arch = "wasm32"))]
- fn spawn(&self, future: impl Future<Output = ()> + Send + 'static);
-
- /// Spawns a local future in the [`Executor`].
- #[cfg(target_arch = "wasm32")]
- fn spawn(&self, future: impl Future<Output = ()> + 'static);
+ fn spawn(&self, future: impl Future<Output = ()> + MaybeSend + 'static);
/// Runs the given closure inside the [`Executor`].
///