Trait fred::interfaces::PubsubInterface
source · pub trait PubsubInterface: ClientLike + Sized {
Show 13 methods
// Provided methods
fn subscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>
where S: Into<MultipleStrings> { ... }
fn unsubscribe<S>(
&self,
channels: S,
) -> impl Future<Output = RedisResult<()>>
where S: Into<MultipleStrings> { ... }
fn psubscribe<S>(
&self,
patterns: S,
) -> impl Future<Output = RedisResult<()>>
where S: Into<MultipleStrings> { ... }
fn punsubscribe<S>(
&self,
patterns: S,
) -> impl Future<Output = RedisResult<()>>
where S: Into<MultipleStrings> { ... }
fn publish<R, S, V>(
&self,
channel: S,
message: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
S: Into<Str>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn ssubscribe<C>(
&self,
channels: C,
) -> impl Future<Output = RedisResult<()>>
where C: Into<MultipleStrings> { ... }
fn sunsubscribe<C>(
&self,
channels: C,
) -> impl Future<Output = RedisResult<()>>
where C: Into<MultipleStrings> { ... }
fn spublish<R, S, V>(
&self,
channel: S,
message: V,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
S: Into<Str>,
V: TryInto<RedisValue>,
V::Error: Into<RedisError> { ... }
fn pubsub_channels<R, S>(
&self,
pattern: S,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
S: Into<Str> { ... }
fn pubsub_numpat<R>(&self) -> impl Future<Output = RedisResult<R>>
where R: FromRedis { ... }
fn pubsub_numsub<R, S>(
&self,
channels: S,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
S: Into<MultipleStrings> { ... }
fn pubsub_shardchannels<R, S>(
&self,
pattern: S,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
S: Into<Str> { ... }
fn pubsub_shardnumsub<R, S>(
&self,
channels: S,
) -> impl Future<Output = RedisResult<R>>
where R: FromRedis,
S: Into<MultipleStrings> { ... }
}i-pubsub only.Expand description
Functions that implement the pubsub interface.
Provided Methods§
sourcefn subscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
fn subscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
Subscribe to a channel on the publish-subscribe interface.
sourcefn unsubscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
fn unsubscribe<S>(&self, channels: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
Unsubscribe from a channel on the PubSub interface.
sourcefn psubscribe<S>(&self, patterns: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
fn psubscribe<S>(&self, patterns: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
Subscribes the client to the given patterns.
sourcefn punsubscribe<S>(&self, patterns: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
fn punsubscribe<S>(&self, patterns: S) -> impl Future<Output = RedisResult<()>>where
S: Into<MultipleStrings>,
Unsubscribes the client from the given patterns, or from all of them if none is given.
If no channels are provided this command returns an empty array.
sourcefn publish<R, S, V>(
&self,
channel: S,
message: V,
) -> impl Future<Output = RedisResult<R>>
fn publish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = RedisResult<R>>
Publish a message on the PubSub interface, returning the number of clients that received the message.
sourcefn ssubscribe<C>(&self, channels: C) -> impl Future<Output = RedisResult<()>>where
C: Into<MultipleStrings>,
fn ssubscribe<C>(&self, channels: C) -> impl Future<Output = RedisResult<()>>where
C: Into<MultipleStrings>,
Subscribes the client to the specified shard channels.
sourcefn sunsubscribe<C>(&self, channels: C) -> impl Future<Output = RedisResult<()>>where
C: Into<MultipleStrings>,
fn sunsubscribe<C>(&self, channels: C) -> impl Future<Output = RedisResult<()>>where
C: Into<MultipleStrings>,
Unsubscribes the client from the given shard channels, or from all of them if none is given.
If no channels are provided this command returns an empty array.
sourcefn spublish<R, S, V>(
&self,
channel: S,
message: V,
) -> impl Future<Output = RedisResult<R>>
fn spublish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = RedisResult<R>>
Posts a message to the given shard channel.
sourcefn pubsub_channels<R, S>(
&self,
pattern: S,
) -> impl Future<Output = RedisResult<R>>
fn pubsub_channels<R, S>( &self, pattern: S, ) -> impl Future<Output = RedisResult<R>>
Lists the currently active channels.
sourcefn pubsub_numpat<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
fn pubsub_numpat<R>(&self) -> impl Future<Output = RedisResult<R>>where
R: FromRedis,
Returns the number of unique patterns that are subscribed to by clients.
sourcefn pubsub_numsub<R, S>(
&self,
channels: S,
) -> impl Future<Output = RedisResult<R>>
fn pubsub_numsub<R, S>( &self, channels: S, ) -> impl Future<Output = RedisResult<R>>
Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels.
sourcefn pubsub_shardchannels<R, S>(
&self,
pattern: S,
) -> impl Future<Output = RedisResult<R>>
fn pubsub_shardchannels<R, S>( &self, pattern: S, ) -> impl Future<Output = RedisResult<R>>
Lists the currently active shard channels.
sourcefn pubsub_shardnumsub<R, S>(
&self,
channels: S,
) -> impl Future<Output = RedisResult<R>>
fn pubsub_shardnumsub<R, S>( &self, channels: S, ) -> impl Future<Output = RedisResult<R>>
Returns the number of subscribers for the specified shard channels.