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 { ... }
}i-pubsub only.Expand description
Functions that implement the pubsub interface.
Provided Methods§
Sourcefn subscribe<S>(
&self,
channels: S,
) -> impl Future<Output = FredResult<()>> + Send
fn subscribe<S>( &self, channels: S, ) -> impl Future<Output = FredResult<()>> + Send
Subscribe to a channel on the publish-subscribe interface.
Sourcefn unsubscribe<S>(
&self,
channels: S,
) -> impl Future<Output = FredResult<()>> + Send
fn unsubscribe<S>( &self, channels: S, ) -> impl Future<Output = FredResult<()>> + Send
Unsubscribe from a channel on the PubSub interface.
Sourcefn psubscribe<S>(
&self,
patterns: S,
) -> impl Future<Output = FredResult<()>> + Send
fn psubscribe<S>( &self, patterns: S, ) -> impl Future<Output = FredResult<()>> + Send
Subscribes the client to the given patterns.
Sourcefn punsubscribe<S>(
&self,
patterns: S,
) -> impl Future<Output = FredResult<()>> + Send
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.
Sourcefn publish<R, S, V>(
&self,
channel: S,
message: V,
) -> impl Future<Output = FredResult<R>> + Send
fn publish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = FredResult<R>> + Send
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 = FredResult<()>> + Send
fn ssubscribe<C>( &self, channels: C, ) -> impl Future<Output = FredResult<()>> + Send
Subscribes the client to the specified shard channels.
Sourcefn sunsubscribe<C>(
&self,
channels: C,
) -> impl Future<Output = FredResult<()>> + Send
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.
Sourcefn spublish<R, S, V>(
&self,
channel: S,
message: V,
) -> impl Future<Output = FredResult<R>> + Send
fn spublish<R, S, V>( &self, channel: S, message: V, ) -> impl Future<Output = FredResult<R>> + Send
Posts a message to the given shard channel.
Sourcefn pubsub_channels<R, S>(
&self,
pattern: S,
) -> impl Future<Output = FredResult<R>> + Send
fn pubsub_channels<R, S>( &self, pattern: S, ) -> impl Future<Output = FredResult<R>> + Send
Lists the currently active channels.
Sourcefn pubsub_numpat<R>(&self) -> impl Future<Output = FredResult<R>> + Sendwhere
R: FromValue,
fn pubsub_numpat<R>(&self) -> impl Future<Output = FredResult<R>> + Sendwhere
R: FromValue,
Returns the number of unique patterns that are subscribed to by clients.
Sourcefn pubsub_numsub<R, S>(
&self,
channels: S,
) -> impl Future<Output = FredResult<R>> + Send
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.
Sourcefn pubsub_shardchannels<R, S>(
&self,
pattern: S,
) -> impl Future<Output = FredResult<R>> + Send
fn pubsub_shardchannels<R, S>( &self, pattern: S, ) -> impl Future<Output = FredResult<R>> + Send
Lists the currently active shard channels.
Sourcefn pubsub_shardnumsub<R, S>(
&self,
channels: S,
) -> impl Future<Output = FredResult<R>> + Send
fn pubsub_shardnumsub<R, S>( &self, channels: S, ) -> impl Future<Output = FredResult<R>> + Send
Returns the number of subscribers for the specified shard channels.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".