summaryrefslogtreecommitdiffstats
path: root/futures/src/executor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'futures/src/executor.rs')
-rw-r--r--futures/src/executor.rs42
1 files changed, 2 insertions, 40 deletions
diff --git a/futures/src/executor.rs b/futures/src/executor.rs
index 23682f32..5ac76081 100644
--- a/futures/src/executor.rs
+++ b/futures/src/executor.rs
@@ -1,38 +1,5 @@
//! Choose your preferred executor to power a runtime.
-mod null;
-
-#[cfg(all(not(target_arch = "wasm32"), feature = "thread-pool"))]
-mod thread_pool;
-
-#[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))]
-mod tokio;
-
-#[cfg(all(not(target_arch = "wasm32"), feature = "async-std"))]
-mod async_std;
-
-#[cfg(all(not(target_arch = "wasm32"), feature = "smol"))]
-mod smol;
-
-#[cfg(target_arch = "wasm32")]
-mod wasm_bindgen;
-
-pub use null::Null;
-
-#[cfg(all(not(target_arch = "wasm32"), feature = "thread-pool"))]
-pub use thread_pool::ThreadPool;
-
-#[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))]
-pub use self::tokio::Tokio;
-
-#[cfg(all(not(target_arch = "wasm32"), feature = "async-std"))]
-pub use self::async_std::AsyncStd;
-
-#[cfg(all(not(target_arch = "wasm32"), feature = "smol"))]
-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 +10,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`].
///