pub trait AppEventSource: Send + Sync {
// Required method
fn subscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Receiver<AppEvent>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Source of AppEvents produced by the application core that front-ends can
listen to for UI updates.
Implementations typically wrap an mpsc::Receiver<AppEvent> or forward
events from an external transport (e.g. gRPC stream).
Required Methods§
Sourcefn subscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Receiver<AppEvent>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Receiver<AppEvent>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Obtain a receiver that yields application events. A fresh receiver should be returned on every call so multiple consumers can coexist.