AsyncSubscriber

Trait AsyncSubscriber 

Source
pub trait AsyncSubscriber: Send + Sync {
    // Required methods
    fn subscribe_to_bytes<'life0, 'async_trait>(
        &'life0 self,
        topic: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: '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>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn receiver(&self) -> &Receiver ;

    // Provided methods
    fn subscribe_to<'life0, 'life1, 'async_trait, Topic>(
        &'life0 self,
        topic: &'life1 Topic,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Topic: 'async_trait + Serialize + Send + Sync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: '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>>
       where Topic: 'async_trait + Serialize + Send + Sync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

A subscriber to one or more topics.

Required Methods§

Source

fn subscribe_to_bytes<'life0, 'async_trait>( &'life0 self, topic: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to Messages published to topic.

Source

fn unsubscribe_from_bytes<'life0, 'life1, 'async_trait>( &'life0 self, topic: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unsubscribe from Messages published to topic.

Source

fn receiver(&self) -> &Receiver

Returns the receiver to receive Messages.

Provided Methods§

Source

fn subscribe_to<'life0, 'life1, 'async_trait, Topic>( &'life0 self, topic: &'life1 Topic, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Topic: 'async_trait + Serialize + Send + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Subscribe to Messages published to topic.

Source

fn unsubscribe_from<'life0, 'life1, 'async_trait, Topic>( &'life0 self, topic: &'life1 Topic, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Topic: 'async_trait + Serialize + Send + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unsubscribe from Messages published to topic.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§