diff options
author | 2020-02-06 10:21:52 -0600 | |
---|---|---|
committer | 2020-02-06 10:21:52 -0600 | |
commit | 97c308076ff93d09eb874f8e954aae4c7c5deaf7 (patch) | |
tree | c3a4ec76931c8153c932c364fa393e25d39d74f0 /futures/src/executor.rs | |
parent | 7b892eb3e11596925a2993bcc4175ac09ff3768a (diff) | |
parent | 36e617ae70cc7a86ce998cbd61f6aa702bb42933 (diff) | |
download | iced-97c308076ff93d09eb874f8e954aae4c7c5deaf7.tar.gz iced-97c308076ff93d09eb874f8e954aae4c7c5deaf7.tar.bz2 iced-97c308076ff93d09eb874f8e954aae4c7c5deaf7.zip |
Merge pull request #180 from hecrj/feature/web-styling
Custom styling for `iced_web`
Diffstat (limited to 'futures/src/executor.rs')
-rw-r--r-- | futures/src/executor.rs | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/futures/src/executor.rs b/futures/src/executor.rs index c2b9cc72..5378c0b3 100644 --- a/futures/src/executor.rs +++ b/futures/src/executor.rs @@ -1,13 +1,13 @@ //! 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(feature = "tokio")] +#[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))] mod tokio; -#[cfg(feature = "async-std")] +#[cfg(all(not(target_arch = "wasm32"), feature = "async-std"))] mod async_std; #[cfg(target_arch = "wasm32")] @@ -15,13 +15,13 @@ 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(feature = "tokio")] +#[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))] pub use self::tokio::Tokio; -#[cfg(feature = "async-std")] +#[cfg(all(not(target_arch = "wasm32"), feature = "async-std"))] pub use self::async_std::AsyncStd; #[cfg(target_arch = "wasm32")] @@ -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 |