summaryrefslogtreecommitdiffstats
path: root/futures/src/executor
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-20 05:43:09 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-20 05:43:09 +0100
commit04086a90c9e933ebfb42de378054e1115b33529d (patch)
treef0a9e25216807f9a20d757eadf420456d16f613f /futures/src/executor
parent90690702e1e4abab804ec91e8ff4183824bec436 (diff)
downloadiced-04086a90c9e933ebfb42de378054e1115b33529d.tar.gz
iced-04086a90c9e933ebfb42de378054e1115b33529d.tar.bz2
iced-04086a90c9e933ebfb42de378054e1115b33529d.zip
Implement `WasmBindgen` executor and reorganize
Diffstat (limited to 'futures/src/executor')
-rw-r--r--futures/src/executor/wasm_bindgen.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/futures/src/executor/wasm_bindgen.rs b/futures/src/executor/wasm_bindgen.rs
new file mode 100644
index 00000000..70a8ea8e
--- /dev/null
+++ b/futures/src/executor/wasm_bindgen.rs
@@ -0,0 +1,17 @@
+use crate::Executor;
+
+#[derive(Debug)]
+pub struct WasmBindgen;
+
+impl Executor for WasmBindgen {
+ fn new() -> Result<Self, futures::io::Error> {
+ Ok(Self)
+ }
+
+ fn spawn(
+ &self,
+ future: impl futures::Future<Output = ()> + Send + 'static,
+ ) {
+ wasm_bindgen_futures::spawn_local(future);
+ }
+}