summaryrefslogtreecommitdiffstats
path: root/core/src/runtime
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-19 09:06:48 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-19 09:06:48 +0100
commitd50ff9b5d97d9c3d6c6c70a9b4efe764b6126c86 (patch)
treee5d176cddb6ef341d4050effc490e98988cf22d9 /core/src/runtime
parent32f7ca261f0655938ae7c8919599b020ddea8ff8 (diff)
downloadiced-d50ff9b5d97d9c3d6c6c70a9b4efe764b6126c86.tar.gz
iced-d50ff9b5d97d9c3d6c6c70a9b4efe764b6126c86.tar.bz2
iced-d50ff9b5d97d9c3d6c6c70a9b4efe764b6126c86.zip
Implement `Runtime` and `Executor` in `iced_core`
They can be leveraged by shells to easily execute commands and track subscriptions.
Diffstat (limited to 'core/src/runtime')
-rw-r--r--core/src/runtime/executor.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/src/runtime/executor.rs b/core/src/runtime/executor.rs
new file mode 100644
index 00000000..d171c6d5
--- /dev/null
+++ b/core/src/runtime/executor.rs
@@ -0,0 +1,11 @@
+use futures::Future;
+
+pub trait Executor {
+ fn new() -> Self;
+
+ fn spawn(&self, future: impl Future<Output = ()> + Send + 'static);
+
+ fn enter<R>(&self, f: impl FnOnce() -> R) -> R {
+ f()
+ }
+}