pub trait Notifications: Send + Sync {
// Required methods
fn subscribe<'life0, 'async_trait>(
&'life0 self,
subscription: Subscription,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
notification: ChangeNotification,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Public trait for notification backends.
Required Methods§
Sourcefn subscribe<'life0, 'async_trait>(
&'life0 self,
subscription: Subscription,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
subscription: Subscription,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register a subscription for a topic.
Sourcefn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a subscription.
Sourcefn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
notification: ChangeNotification,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
notification: ChangeNotification,
) -> Pin<Box<dyn Future<Output = Result<(), PodError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deliver a notification to all subscribers of topic.