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

pub trait AsyncPubSub: Send + Sync {
    type Subscriber: AsyncSubscriber;
    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_bytes<'life0, 'async_trait>(
        &'life0 self,
        topic: Vec<u8, Global>,
        payload: Vec<u8, Global>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn publish_bytes_to_all<'life0, 'async_trait>(
        &'life0 self,
        topics: impl IntoIterator<Item = Vec<u8, Global>> + Send + 'async_trait,
        payload: Vec<u8, Global>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn publish<'life0, 'life1, 'life2, 'async_trait, Topic, Payload>(
        &'life0 self,
        topic: &'life1 Topic,
        payload: &'life2 Payload
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Topic: 'async_trait + Serialize + Send + Sync,
        Payload: 'async_trait + Serialize + Send + Sync,
        Self: 'async_trait
, { ... }
fn publish_to_all<'topics, 'life0, 'life1, 'async_trait, Topics, Topic, Payload>(
        &'life0 self,
        topics: Topics,
        payload: &'life1 Payload
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
    where
        'topics: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Topics: 'async_trait + 'topics + IntoIterator<Item = &'topics Topic> + Send,
        Topic: 'async_trait + 'topics + Serialize + Send,
        Payload: 'async_trait + Serialize + Send + Sync,
        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.

Provided methods

Publishes a payload to all subscribers of topic.

Publishes a payload to all subscribers of all topics.

Implementors

Uses CustomServer’s PubSub relay.