Skip to main content

PubsubInterface

Trait PubsubInterface 

Source
pub trait PubsubInterface:
    ClientLike
    + Sized
    + Send {
Show 13 methods // Provided methods fn subscribe<S>( &self, channels: S, ) -> impl Future<Output = FredResult<()>> + Send where S: Into<MultipleStrings> + Send { ... } fn unsubscribe<S>( &self, channels: S, ) -> impl Future<Output = FredResult<()>> + Send where S: Into<MultipleStrings> + Send { ... } fn psubscribe<S>( &self, patterns: S, ) -> impl Future<Output = FredResult<()>> + Send where S: Into<MultipleStrings> + Send { ... } fn punsubscribe<S>( &self, patterns: S, ) -> impl Future<Output = FredResult<()>> + Send where S: Into<MultipleStrings> + Send { ... } fn publish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, S: Into<Str> + Send, V: TryInto<Value> + Send, V::Error: Into<Error> + Send { ... } fn ssubscribe<C>( &self, channels: C, ) -> impl Future<Output = FredResult<()>> + Send where C: Into<MultipleStrings> + Send { ... } fn sunsubscribe<C>( &self, channels: C, ) -> impl Future<Output = FredResult<()>> + Send where C: Into<MultipleStrings> + Send { ... } fn spublish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, S: Into<Str> + Send, V: TryInto<Value> + Send, V::Error: Into<Error> + Send { ... } fn pubsub_channels<R, S>( &self, pattern: S, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, S: Into<Str> + Send { ... } fn pubsub_numpat<R>(&self) -> impl Future<Output = FredResult<R>> + Send where R: FromValue { ... } fn pubsub_numsub<R, S>( &self, channels: S, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, S: Into<MultipleStrings> + Send { ... } fn pubsub_shardchannels<R, S>( &self, pattern: S, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, S: Into<Str> + Send { ... } fn pubsub_shardnumsub<R, S>( &self, channels: S, ) -> impl Future<Output = FredResult<R>> + Send where R: FromValue, S: Into<MultipleStrings> + Send { ... }
}
Available on crate feature i-pubsub only.
Expand description

Functions that implement the pubsub interface.

Provided Methods§

Source

fn subscribe<S>( &self, channels: S, ) -> impl Future<Output = FredResult<()>> + Send

Subscribe to a channel on the publish-subscribe interface.

https://redis.io/commands/subscribe

Source

fn unsubscribe<S>( &self, channels: S, ) -> impl Future<Output = FredResult<()>> + Send

Unsubscribe from a channel on the PubSub interface.

https://redis.io/commands/unsubscribe

Source

fn psubscribe<S>( &self, patterns: S, ) -> impl Future<Output = FredResult<()>> + Send

Subscribes the client to the given patterns.

https://redis.io/commands/psubscribe

Source

fn punsubscribe<S>( &self, patterns: S, ) -> impl Future<Output = FredResult<()>> + Send

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.

https://redis.io/commands/punsubscribe

Source

fn publish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, S: Into<Str> + Send, V: TryInto<Value> + Send, V::Error: Into<Error> + Send,

Publish a message on the PubSub interface, returning the number of clients that received the message.

https://redis.io/commands/publish

Source

fn ssubscribe<C>( &self, channels: C, ) -> impl Future<Output = FredResult<()>> + Send

Subscribes the client to the specified shard channels.

https://redis.io/commands/ssubscribe/

Source

fn sunsubscribe<C>( &self, channels: C, ) -> impl Future<Output = FredResult<()>> + Send

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.

https://redis.io/commands/sunsubscribe/

Source

fn spublish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, S: Into<Str> + Send, V: TryInto<Value> + Send, V::Error: Into<Error> + Send,

Posts a message to the given shard channel.

https://redis.io/commands/spublish/

Source

fn pubsub_channels<R, S>( &self, pattern: S, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, S: Into<Str> + Send,

Lists the currently active channels.

https://redis.io/commands/pubsub-channels/

Source

fn pubsub_numpat<R>(&self) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue,

Returns the number of unique patterns that are subscribed to by clients.

https://redis.io/commands/pubsub-numpat/

Source

fn pubsub_numsub<R, S>( &self, channels: S, ) -> impl Future<Output = FredResult<R>> + Send

Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels.

https://redis.io/commands/pubsub-numsub/

Source

fn pubsub_shardchannels<R, S>( &self, pattern: S, ) -> impl Future<Output = FredResult<R>> + Send
where R: FromValue, S: Into<Str> + Send,

Lists the currently active shard channels.

https://redis.io/commands/pubsub-shardchannels/

Source

fn pubsub_shardnumsub<R, S>( &self, channels: S, ) -> impl Future<Output = FredResult<R>> + Send

Returns the number of subscribers for the specified shard channels.

https://redis.io/commands/pubsub-shardnumsub/

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§