diff options
author | 2020-01-20 04:47:36 +0100 | |
---|---|---|
committer | 2020-01-20 04:47:36 +0100 | |
commit | 90690702e1e4abab804ec91e8ff4183824bec436 (patch) | |
tree | d3f989047f4ac5166bc5baed9febcc10af2d63a6 /native | |
parent | 35760ac68f06e783e64e9048aff0fff6df1c09cf (diff) | |
download | iced-90690702e1e4abab804ec91e8ff4183824bec436.tar.gz iced-90690702e1e4abab804ec91e8ff4183824bec436.tar.bz2 iced-90690702e1e4abab804ec91e8ff4183824bec436.zip |
Add `Application::Executor` associated type
Diffstat (limited to 'native')
-rw-r--r-- | native/Cargo.toml | 2 | ||||
-rw-r--r-- | native/src/lib.rs | 7 | ||||
-rw-r--r-- | native/src/runtime.rs | 2 | ||||
-rw-r--r-- | native/src/subscription.rs | 2 | ||||
-rw-r--r-- | native/src/subscription/events.rs | 3 |
5 files changed, 9 insertions, 7 deletions
diff --git a/native/Cargo.toml b/native/Cargo.toml index 57a869e2..6276535e 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -11,7 +11,6 @@ repository = "https://github.com/hecrj/iced" twox-hash = "1.5" raw-window-handle = "0.3" unicode-segmentation = "1.6" -futures = "0.3" [dependencies.iced_core] version = "0.1.0" @@ -20,3 +19,4 @@ path = "../core" [dependencies.iced_futures] version = "0.1.0-alpha" path = "../futures" +features = ["thread-pool"] diff --git a/native/src/lib.rs b/native/src/lib.rs index 7730c6a3..b5856c00 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -42,7 +42,6 @@ pub mod input; pub mod layout; pub mod renderer; -pub mod runtime; pub mod subscription; pub mod widget; pub mod window; @@ -52,6 +51,7 @@ mod element; mod event; mod hasher; mod mouse_cursor; +mod runtime; mod size; mod user_interface; @@ -59,7 +59,10 @@ pub use iced_core::{ Align, Background, Color, Font, HorizontalAlignment, Length, Point, Rectangle, Vector, VerticalAlignment, }; -pub use iced_futures::Command; +pub use iced_futures::{executor, futures, Command}; + +#[doc(no_inline)] +pub use executor::Executor; pub use clipboard::Clipboard; pub use element::Element; diff --git a/native/src/runtime.rs b/native/src/runtime.rs index 2b3abbf1..9fa031f4 100644 --- a/native/src/runtime.rs +++ b/native/src/runtime.rs @@ -10,5 +10,3 @@ use crate::{Event, Hasher}; /// [`Subscription`]: ../struct.Subscription.html pub type Runtime<Executor, Receiver, Message> = iced_futures::Runtime<Hasher, Event, Executor, Receiver, Message>; - -pub use iced_futures::runtime::Executor; diff --git a/native/src/subscription.rs b/native/src/subscription.rs index 43f1758a..0d002c6c 100644 --- a/native/src/subscription.rs +++ b/native/src/subscription.rs @@ -1,6 +1,6 @@ //! Listen to external events in your application. use crate::{Event, Hasher}; -use futures::stream::BoxStream; +use iced_futures::futures::stream::BoxStream; /// A request to listen to external events. /// diff --git a/native/src/subscription/events.rs b/native/src/subscription/events.rs index 6ff2c0fb..7d33166e 100644 --- a/native/src/subscription/events.rs +++ b/native/src/subscription/events.rs @@ -2,6 +2,7 @@ use crate::{ subscription::{EventStream, Recipe}, Event, Hasher, }; +use iced_futures::futures::stream::BoxStream; pub struct Events; @@ -17,7 +18,7 @@ impl Recipe<Hasher, Event> for Events { fn stream( self: Box<Self>, event_stream: EventStream, - ) -> futures::stream::BoxStream<'static, Self::Output> { + ) -> BoxStream<'static, Self::Output> { event_stream } } |