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
Add a subscription to a topic.
Add several subscriptions to a topic.
Remove a subscription to a topic.
Remove several subscriptions to a topic.
Implementors
impl<'a, K: Clone + Eq + Hash, V: Clone + Eq + Hash + DeserializeOwned + Serialize, D: DeserializeOwned + Serialize> PubSub<K, V, D> for RedisPubSub<'a, K, V, D>
This is supported on crate feature
redis-backend
only.impl<ClientKey: Clone + Eq + Hash, TopicKey: Clone + Eq + Hash, Data> PubSub<ClientKey, TopicKey, Data> for Hive<ClientKey, TopicKey, Data>
impl<K: Clone + Eq + Hash, V: Clone + Eq + Hash + DeserializeOwned + Serialize, D: DeserializeOwned + Serialize> PubSub<K, V, D> for MongodbPubSub<K, V, D>
This is supported on crate feature
mongo-backend
only.