summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2021-01-15 19:04:23 +0100
committerLibravatar GitHub <noreply@github.com>2021-01-15 19:04:23 +0100
commit2056304e39c32ef5613eb6e82036586043002c08 (patch)
treed6f780a018222ed4a4476cfbc634543c7499b462 /src
parent984583b0cca86d7ba8f865489cbebeb181349c19 (diff)
parentfd2c96c8e36eb37ea4a53aafe0986b569a4e3753 (diff)
downloadiced-2056304e39c32ef5613eb6e82036586043002c08.tar.gz
iced-2056304e39c32ef5613eb6e82036586043002c08.tar.bz2
iced-2056304e39c32ef5613eb6e82036586043002c08.zip
Merge pull request #699 from JayceFayne/smol
Add `smol` async runtime support
Diffstat (limited to '')
-rw-r--r--src/executor.rs17
-rw-r--r--src/lib.rs8
2 files changed, 21 insertions, 4 deletions
diff --git a/src/executor.rs b/src/executor.rs
index 0333bc1d..9f3656b1 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -10,19 +10,30 @@ mod platform {
#[cfg(feature = "tokio_old")]
type Executor = executor::TokioOld;
- #[cfg(all(not(feature = "tokio_old"), feature = "tokio"))]
+ #[cfg(all(feature = "tokio", not(feature = "tokio_old")))]
type Executor = executor::Tokio;
#[cfg(all(
+ feature = "async-std",
not(any(feature = "tokio_old", feature = "tokio")),
- feature = "async-std"
))]
type Executor = executor::AsyncStd;
+ #[cfg(all(
+ feature = "smol",
+ not(any(
+ feature = "tokio_old",
+ feature = "tokio",
+ feature = "async-std"
+ )),
+ ))]
+ 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;