summaryrefslogtreecommitdiffstats
path: root/src/executor.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-03-31 17:49:56 +0200
committerLibravatar GitHub <noreply@github.com>2020-03-31 17:49:56 +0200
commite79e832092385346beec47f63e40f24800c535f8 (patch)
treec29df36b1987de66a58cfb981c5958d25712d51e /src/executor.rs
parent327347501c78a1c8e55a39fe1b5d54d7c2fcbcab (diff)
parentf0ebcc24742aba79cc779a4145a188f2534a5e35 (diff)
downloadiced-e79e832092385346beec47f63e40f24800c535f8.tar.gz
iced-e79e832092385346beec47f63e40f24800c535f8.tar.bz2
iced-e79e832092385346beec47f63e40f24800c535f8.zip
Merge pull request #246 from hecrj/feature/application-flags
Application flags
Diffstat (limited to 'src/executor.rs')
-rw-r--r--src/executor.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/executor.rs b/src/executor.rs
index b4be5264..6c5425d1 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -51,7 +51,11 @@ mod platform {
/// A default cross-platform executor.
///
- /// - On native platforms, it will use `iced_futures::executor::ThreadPool`.
+ /// - On native platforms, it will use:
+ /// - `iced_futures::executor::Tokio` when the `tokio` feature is enabled.
+ /// - `iced_futures::executor::AsyncStd` when the `async-std` feature is
+ /// enabled.
+ /// - `iced_futures::executor::ThreadPool` otherwise.
/// - On the Web, it will use `iced_futures::executor::WasmBindgen`.
#[derive(Debug)]
pub struct Default(WasmBindgen);
@@ -64,5 +68,9 @@ mod platform {
fn spawn(&self, future: impl futures::Future<Output = ()> + 'static) {
self.0.spawn(future);
}
+
+ fn enter<R>(&self, f: impl FnOnce() -> R) -> R {
+ self.0.enter(f)
+ }
}
}