diff options
author | 2020-03-26 19:33:00 +0100 | |
---|---|---|
committer | 2020-03-26 19:33:00 +0100 | |
commit | 9ef1801ed647868b624f1e1999141e74a292b980 (patch) | |
tree | 7028f6e3c6f28c3d14392e5d1b3bb07586955c28 /futures/src/lib.rs | |
parent | 643fa18cae19fa1418a23b652b6b4b8bf8ef79fc (diff) | |
parent | 338fff35ac821e6b03d68bd94418de500fb50f77 (diff) | |
download | iced-9ef1801ed647868b624f1e1999141e74a292b980.tar.gz iced-9ef1801ed647868b624f1e1999141e74a292b980.tar.bz2 iced-9ef1801ed647868b624f1e1999141e74a292b980.zip |
Merge pull request #234 from hecrj/improvement/subscription-send-requirement
Improve compatibility of `iced_futures`
Diffstat (limited to 'futures/src/lib.rs')
-rw-r--r-- | futures/src/lib.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/futures/src/lib.rs b/futures/src/lib.rs index c25c0853..79178931 100644 --- a/futures/src/lib.rs +++ b/futures/src/lib.rs @@ -16,3 +16,31 @@ pub use command::Command; pub use executor::Executor; pub use runtime::Runtime; pub use subscription::Subscription; + +/// A boxed static future. +/// +/// - On native platforms, it needs a `Send` requirement. +/// - On the Web platform, it does not need a `Send` requirement. +#[cfg(not(target_arch = "wasm32"))] +pub type BoxFuture<T> = futures::future::BoxFuture<'static, T>; + +/// A boxed static future. +/// +/// - On native platforms, it needs a `Send` requirement. +/// - On the Web platform, it does not need a `Send` requirement. +#[cfg(target_arch = "wasm32")] +pub type BoxFuture<T> = futures::future::LocalBoxFuture<'static, T>; + +/// A boxed static stream. +/// +/// - On native platforms, it needs a `Send` requirement. +/// - On the Web platform, it does not need a `Send` requirement. +#[cfg(not(target_arch = "wasm32"))] +pub type BoxStream<T> = futures::stream::BoxStream<'static, T>; + +/// A boxed static stream. +/// +/// - On native platforms, it needs a `Send` requirement. +/// - On the Web platform, it does not need a `Send` requirement. +#[cfg(target_arch = "wasm32")] +pub type BoxStream<T> = futures::stream::LocalBoxStream<'static, T>; |