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

pub trait PubSub {
    type Subscriber: Subscriber;
    fn create_subscriber(&self) -> Result<Self::Subscriber, Error>;
fn publish_bytes(
        &self,
        topic: Vec<u8, Global>,
        payload: Vec<u8, Global>
    ) -> Result<(), Error>;
fn publish_bytes_to_all(
        &self,
        topics: impl IntoIterator<Item = Vec<u8, Global>> + Send,
        payload: Vec<u8, Global>
    ) -> Result<(), Error>; fn publish<Topic, Payload>(
        &self,
        topic: &Topic,
        payload: &Payload
    ) -> Result<(), Error>
    where
        Topic: Serialize,
        Payload: Serialize
, { ... }
fn publish_to_all<'topics, Topics, Topic, Payload>(
        &self,
        topics: Topics,
        payload: &Payload
    ) -> Result<(), Error>
    where
        Topics: 'topics + IntoIterator<Item = &'topics Topic>,
        Topic: 'topics + Serialize,
        Payload: Serialize
, { ... } }
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