pub struct RedisPubSub<'a, K: Clone + Eq + Hash, V: Clone + Eq + Hash + DeserializeOwned + Serialize, D: DeserializeOwned + Serialize> {
pub hive: Hive<K, V, D>,
/* private fields */
}
Available on crate feature
redis-backend
only.Expand description
Redis pubsub
Fields§
§hive: Hive<K, V, D>
Implementations§
Source§impl<'a, K: Clone + Eq + Hash, V: Clone + Eq + Hash + DeserializeOwned + Serialize + From<String>, D: DeserializeOwned + Serialize> RedisPubSub<'a, K, V, D>
impl<'a, K: Clone + Eq + Hash, V: Clone + Eq + Hash + DeserializeOwned + Serialize + From<String>, D: DeserializeOwned + Serialize> RedisPubSub<'a, K, V, D>
pub fn new<F: 'static + Fn(Vec<K>, D) + Send>( callback: F, pool: &'a Pool<RedisConnectionManager>, pubsub: Arc<Mutex<RedisPS>>, ) -> RedisPubSub<'a, K, V, D>
Sourcepub fn set_source(&mut self, source: String)
pub fn set_source(&mut self, source: String)
Set the id of this source.
Used for testing.
Trait Implementations§
Source§impl<'a, K: Clone + Clone + Eq + Hash, V: Clone + Clone + Eq + Hash + DeserializeOwned + Serialize, D: Clone + DeserializeOwned + Serialize> Clone for RedisPubSub<'a, K, V, D>
impl<'a, K: Clone + Clone + Eq + Hash, V: Clone + Clone + Eq + Hash + DeserializeOwned + Serialize, D: Clone + DeserializeOwned + Serialize> Clone for RedisPubSub<'a, K, V, D>
Source§fn clone(&self) -> RedisPubSub<'a, K, V, D>
fn clone(&self) -> RedisPubSub<'a, K, V, D>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§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>
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>
Source§fn subscribe_multiple(&self, client: K, topics: Vec<V>) -> Result<(), String>
fn subscribe_multiple(&self, client: K, topics: Vec<V>) -> Result<(), String>
Add several subscriptions to a topic.
Source§fn unsubscribe(&self, client: &K, topic: &V) -> Result<(), String>
fn unsubscribe(&self, client: &K, topic: &V) -> Result<(), String>
Remove a subscription to a topic.
Auto Trait Implementations§
impl<'a, K, V, D> Freeze for RedisPubSub<'a, K, V, D>
impl<'a, K, V, D> !RefUnwindSafe for RedisPubSub<'a, K, V, D>
impl<'a, K, V, D> Send for RedisPubSub<'a, K, V, D>
impl<'a, K, V, D> Sync for RedisPubSub<'a, K, V, D>
impl<'a, K, V, D> Unpin for RedisPubSub<'a, K, V, D>
impl<'a, K, V, D> !UnwindSafe for RedisPubSub<'a, K, V, D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more