diff options
author | 2020-01-21 00:15:01 +0100 | |
---|---|---|
committer | 2020-01-21 00:15:01 +0100 | |
commit | 7016221556ea8183ebcd8ef8df00044e2eda71e7 (patch) | |
tree | bc1609b71b88437fc7497af339b6427f63121c76 /examples/stopwatch/src/main.rs | |
parent | 6ca5e6184f9f1c12b427bdafcce0b4e9fbc5bb14 (diff) | |
parent | 91d9d65a03ce9b211e4043726e7424949d314325 (diff) | |
download | iced-7016221556ea8183ebcd8ef8df00044e2eda71e7.tar.gz iced-7016221556ea8183ebcd8ef8df00044e2eda71e7.tar.bz2 iced-7016221556ea8183ebcd8ef8df00044e2eda71e7.zip |
Merge pull request #164 from hecrj/feature/custom-runtime
Custom futures executor with `iced_futures`
Diffstat (limited to '')
-rw-r--r-- | examples/stopwatch/src/main.rs (renamed from examples/stopwatch.rs) | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/stopwatch.rs b/examples/stopwatch/src/main.rs index c9a61ee9..d84c4817 100644 --- a/examples/stopwatch.rs +++ b/examples/stopwatch/src/main.rs @@ -28,6 +28,7 @@ enum Message { } impl Application for Stopwatch { + type Executor = iced_futures::executor::AsyncStd; type Message = Message; fn new() -> (Stopwatch, Command<Message>) { @@ -142,6 +143,8 @@ impl Application for Stopwatch { } mod time { + use iced::futures; + pub fn every( duration: std::time::Duration, ) -> iced::Subscription<std::time::Instant> { @@ -165,7 +168,7 @@ mod time { fn stream( self: Box<Self>, - _input: I, + _input: futures::stream::BoxStream<'static, I>, ) -> futures::stream::BoxStream<'static, Self::Output> { use futures::stream::StreamExt; |