Introduce MaybeSend trait in iced_futures

It allows to clean up all the `trait_aliases` modules!
This commit is contained in:
Héctor Ramón Jiménez 2022-01-28 17:35:47 +07:00
parent 83c649b574
commit 5dab5a327e
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
6 changed files with 49 additions and 150 deletions

View file

@ -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`].
///