Skip to main content

AppEventSource

Trait AppEventSource 

Source
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 'life0: 'async_trait,
             Self: '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§

Source

fn subscribe<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Receiver<AppEvent>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Obtain a receiver that yields application events. A fresh receiver should be returned on every call so multiple consumers can coexist.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AppEventSource for GrpcClientAdapter

Source§

fn subscribe<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Receiver<AppEvent>> + Send + 'async_trait>>
where 'life0: 'async_trait, GrpcClientAdapter: 'async_trait,

Implementors§