diff options
author | 2019-12-05 06:10:13 +0100 | |
---|---|---|
committer | 2019-12-05 06:10:13 +0100 | |
commit | d575f4541126e2ab25908fe55c6805f16716b2a5 (patch) | |
tree | 9d5221fe201b64e2ec649228ebae26be819dbf58 /src/application.rs | |
parent | e92ea48e8814b42fc566017db085ca9bdaf3c272 (diff) | |
download | iced-d575f4541126e2ab25908fe55c6805f16716b2a5.tar.gz iced-d575f4541126e2ab25908fe55c6805f16716b2a5.tar.bz2 iced-d575f4541126e2ab25908fe55c6805f16716b2a5.zip |
Draft first version of event subscriptions :tada:
Diffstat (limited to 'src/application.rs')
-rw-r--r-- | src/application.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/application.rs b/src/application.rs index a4d20e68..95113344 100644 --- a/src/application.rs +++ b/src/application.rs @@ -1,4 +1,4 @@ -use crate::{Command, Element, Settings}; +use crate::{Command, Element, Settings, Subscription}; /// An interactive cross-platform application. /// @@ -117,6 +117,11 @@ pub trait Application: Sized { /// [`Command`]: struct.Command.html fn update(&mut self, message: Self::Message) -> Command<Self::Message>; + /// TODO + fn subscriptions(&self) -> Subscription<Self::Message> { + Subscription::none() + } + /// Returns the widgets to display in the [`Application`]. /// /// These widgets can produce __messages__ based on user interaction. @@ -168,6 +173,10 @@ where self.0.update(message) } + fn subscriptions(&self) -> Subscription<Self::Message> { + self.0.subscriptions() + } + fn view(&mut self) -> Element<'_, Self::Message> { self.0.view() } |