Trait bonsaidb::core::pubsub::AsyncSubscriber[][src]

pub trait AsyncSubscriber: Send + Sync {
    fn subscribe_to_bytes<'life0, 'async_trait>(
        &'life0 self,
        topic: Vec<u8, Global>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn unsubscribe_from_bytes<'life0, 'life1, 'async_trait>(
        &'life0 self,
        topic: &'life1 [u8]
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn receiver(&self) -> &Receiver
Notable traits for Receiver
impl Iterator for Receiver type Item = Message;
; fn subscribe_to<'life0, 'life1, 'async_trait, Topic>(
        &'life0 self,
        topic: &'life1 Topic
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Topic: 'async_trait + Serialize + Send + Sync,
        Self: 'async_trait
, { ... }
fn unsubscribe_from<'life0, 'life1, 'async_trait, Topic>(
        &'life0 self,
        topic: &'life1 Topic
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Topic: 'async_trait + Serialize + Send + Sync,
        Self: 'async_trait
, { ... } }
Expand description

A subscriber to one or more topics.

Required methods

Subscribe to Messages published to topic.

Unsubscribe from Messages published to topic.

Returns the receiver to receive Messages.

Provided methods

Subscribe to Messages published to topic.

Unsubscribe from Messages published to topic.

Implementors