diff options
author | 2020-02-05 04:14:26 +0100 | |
---|---|---|
committer | 2020-02-05 04:14:26 +0100 | |
commit | ca213922d043a5532d9ab352c0d54bfca7563871 (patch) | |
tree | ee4ce50991d974144e23030d31ffb11b975cb603 /futures/src/executor.rs | |
parent | 9a06e481b7f52a9d8e123c909d5614332f607c53 (diff) | |
download | iced-ca213922d043a5532d9ab352c0d54bfca7563871.tar.gz iced-ca213922d043a5532d9ab352c0d54bfca7563871.tar.bz2 iced-ca213922d043a5532d9ab352c0d54bfca7563871.zip |
Drop `Send` in `Command` and `Executor` on Wasm
Diffstat (limited to 'futures/src/executor.rs')
-rw-r--r-- | futures/src/executor.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/futures/src/executor.rs b/futures/src/executor.rs index 2a5281af..5378c0b3 100644 --- a/futures/src/executor.rs +++ b/futures/src/executor.rs @@ -1,7 +1,7 @@ //! Choose your preferred executor to power a runtime. mod null; -#[cfg(feature = "thread-pool")] +#[cfg(all(not(target_arch = "wasm32"), feature = "thread-pool"))] mod thread_pool; #[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))] @@ -15,7 +15,7 @@ mod wasm_bindgen; pub use null::Null; -#[cfg(feature = "thread-pool")] +#[cfg(all(not(target_arch = "wasm32"), feature = "thread-pool"))] pub use thread_pool::ThreadPool; #[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))] @@ -41,8 +41,15 @@ pub trait Executor: Sized { /// Spawns a future in the [`Executor`]. /// /// [`Executor`]: trait.Executor.html + #[cfg(not(target_arch = "wasm32"))] fn spawn(&self, future: impl Future<Output = ()> + Send + 'static); + /// Spawns a local future in the [`Executor`]. + /// + /// [`Executor`]: trait.Executor.html + #[cfg(target_arch = "wasm32")] + fn spawn(&self, future: impl Future<Output = ()> + 'static); + /// Runs the given closure inside the [`Executor`]. /// /// Some executors, like `tokio`, require some global state to be in place |