diff options
author | 2024-06-11 19:41:05 +0200 | |
---|---|---|
committer | 2024-06-11 19:41:05 +0200 | |
commit | 5d7dcf417c694853a606b8fb0a47a580277fc9c0 (patch) | |
tree | 8209e3787ee4f4b8ef028fafc9635b1acf777c75 /futures/src/subscription/tracker.rs | |
parent | 83296a73ebbb3c02ed63dfb4661056a8a8962267 (diff) | |
download | iced-5d7dcf417c694853a606b8fb0a47a580277fc9c0.tar.gz iced-5d7dcf417c694853a606b8fb0a47a580277fc9c0.tar.bz2 iced-5d7dcf417c694853a606b8fb0a47a580277fc9c0.zip |
Introduce `subscription::Event`
... and remove `PlatformSpecific` from `Event`
Diffstat (limited to '')
-rw-r--r-- | futures/src/subscription/tracker.rs | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/futures/src/subscription/tracker.rs b/futures/src/subscription/tracker.rs index 086b0f09..f17e3ea3 100644 --- a/futures/src/subscription/tracker.rs +++ b/futures/src/subscription/tracker.rs @@ -1,6 +1,4 @@ -use crate::core::event::{self, Event}; -use crate::core::window; -use crate::subscription::{Hasher, Recipe}; +use crate::subscription::{Event, Hasher, Recipe}; use crate::{BoxFuture, MaybeSend}; use futures::channel::mpsc; @@ -24,9 +22,7 @@ pub struct Tracker { #[derive(Debug)] pub struct Execution { _cancel: futures::channel::oneshot::Sender<()>, - listener: Option< - futures::channel::mpsc::Sender<(Event, event::Status, window::Id)>, - >, + listener: Option<futures::channel::mpsc::Sender<Event>>, } impl Tracker { @@ -142,19 +138,12 @@ impl Tracker { /// currently open. /// /// [`Recipe::stream`]: crate::subscription::Recipe::stream - pub fn broadcast( - &mut self, - event: Event, - status: event::Status, - window: window::Id, - ) { + pub fn broadcast(&mut self, event: Event) { self.subscriptions .values_mut() .filter_map(|connection| connection.listener.as_mut()) .for_each(|listener| { - if let Err(error) = - listener.try_send((event.clone(), status, window)) - { + if let Err(error) = listener.try_send(event.clone()) { log::warn!( "Error sending event to subscription: {error:?}" ); |