Trait hive_pubsub::PubSub[][src]

pub trait PubSub<ClientKey: Clone + Eq + Hash, TopicKey: Clone + Eq + Hash, Data> {
    fn drop_client(&self, id: &ClientKey) -> Result<(), String>;
fn drop_topic(&self, id: &TopicKey) -> Result<(), String>;
fn subscribe(
        &self,
        client: ClientKey,
        topic: TopicKey
    ) -> Result<(), String>;
fn subscribe_multiple(
        &self,
        client: ClientKey,
        topics: Vec<TopicKey>
    ) -> Result<(), String>;
fn unsubscribe(
        &self,
        client: &ClientKey,
        topic: &TopicKey
    ) -> Result<(), String>;
fn unsubscribe_multiple(
        &self,
        client: &ClientKey,
        topics: &Vec<TopicKey>
    ) -> Result<(), String>;
fn publish(&self, topic: &TopicKey, data: Data) -> Result<(), String>; }
Expand description

PubSub trait which provides common actions.

Required methods

Remove a client from the Hive.

Remove a topic from the hive.

Add a subscription to a topic.

Add several subscriptions to a topic.

Remove a subscription to a topic.

Remove several subscriptions to a topic.

Publish a message for a topic in the Hive.

Implementors