summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Jayce Fayne <jayce.fayne@mailbox.org>2021-01-13 01:48:35 +0100
committerLibravatar Jayce Fayne <jayce.fayne@mailbox.org>2021-01-14 12:28:02 +0100
commitb2415eee61063d5c2b220d7b7a513d1952ce2be1 (patch)
tree2a0429981aa745132cb103d9d9bb75972e0c27b6 /src
parent92d647d1a6145e19ef9f540e02faef6a892f51fa (diff)
downloadiced-b2415eee61063d5c2b220d7b7a513d1952ce2be1.tar.gz
iced-b2415eee61063d5c2b220d7b7a513d1952ce2be1.tar.bz2
iced-b2415eee61063d5c2b220d7b7a513d1952ce2be1.zip
Add `smol` async runtime
Diffstat (limited to 'src')
-rw-r--r--src/executor.rs30
-rw-r--r--src/lib.rs8
2 files changed, 31 insertions, 7 deletions
diff --git a/src/executor.rs b/src/executor.rs
index 0333bc1d..2c6d9ec0 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -7,22 +7,40 @@ pub use platform::Default;
mod platform {
use iced_futures::{executor, futures};
- #[cfg(feature = "tokio_old")]
+ #[cfg(all(
+ not(any(feature = "tokio", feature = "smol", feature = "async-std")),
+ feature = "tokio_old"
+ ))]
type Executor = executor::TokioOld;
- #[cfg(all(not(feature = "tokio_old"), feature = "tokio"))]
+ #[cfg(all(
+ not(any(
+ feature = "tokio_old",
+ feature = "smol",
+ feature = "async-std"
+ )),
+ feature = "tokio"
+ ))]
type Executor = executor::Tokio;
+ #[cfg(feature = "async-std")]
+ type Executor = executor::AsyncStd;
+
#[cfg(all(
- not(any(feature = "tokio_old", feature = "tokio")),
- feature = "async-std"
+ not(any(
+ feature = "tokio_old",
+ feature = "tokio",
+ feature = "async-std"
+ )),
+ feature = "smol"
))]
- type Executor = executor::AsyncStd;
+ type Executor = executor::Smol;
#[cfg(not(any(
feature = "tokio_old",
feature = "tokio",
- feature = "async-std"
+ feature = "async-std",
+ feature = "smol",
)))]
type Executor = executor::ThreadPool;
diff --git a/src/lib.rs b/src/lib.rs
index 3578ea82..dedcac7a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -191,7 +191,12 @@ pub mod widget;
pub mod window;
#[cfg(all(
- any(feature = "tokio", feature = "tokio_old", feature = "async-std"),
+ any(
+ feature = "tokio",
+ feature = "tokio_old",
+ feature = "async-std",
+ feature = "smol"
+ ),
not(target_arch = "wasm32")
))]
#[cfg_attr(
@@ -200,6 +205,7 @@ pub mod window;
feature = "tokio",
feature = "tokio_old",
feature = "async-std"
+ feature = "smol"
)))
)]
pub mod time;