pub trait PubSub {
    type Subscriber: Subscriber;
    fn create_subscriber<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Self::Subscriber, Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn publish<'life0, 'life1, 'async_trait, S, P>(
        &'life0 self,
        topic: S,
        payload: &'life1 P
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        S: Into<String> + Send + 'async_trait,
        P: Serialize + Sync + 'async_trait,
        Self: 'async_trait
;
fn publish_to_all<'life0, 'life1, 'async_trait, P>(
        &'life0 self,
        topics: Vec<String, Global>,
        payload: &'life1 P
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        P: Serialize + Sync + 'async_trait,
        Self: 'async_trait
; }
Expand description

Publishes and Subscribes to messages on topics.

Associated Types

The Subscriber type for this PubSub connection.

Required methods

Create a new Subscriber for this relay.

Publishes a payload to all subscribers of topic.

Publishes a payload to all subscribers of all topics.

Implementors

Uses CustomServer’s PubSub relay.