Skip to main content

Notifications

Trait Notifications 

Source
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§

Source

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.

Source

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.

Source

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.

Implementors§