1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use crate::{
resp::{cmd, CommandArg, SingleArgOrCollection},
prepare_command, PreparedCommand,
};
/// A group of Redis commands related to [`Pub/Sub`](https://redis.io/docs/manual/pubsub/)
/// # See Also
/// [Redis Pub/Sub Commands](https://redis.io/commands/?group=pubsub)
pub(crate) trait InternalPubSubCommands {
/// Unsubscribes the client from the given patterns, or from all of them if none is given.
///
/// # See Also
/// [<https://redis.io/commands/punsubscribe/>](https://redis.io/commands/punsubscribe/)
fn punsubscribe<P, PP>(&mut self, patterns: PP) -> PreparedCommand<Self, ()>
where
Self: Sized,
P: Into<CommandArg> + Send,
PP: SingleArgOrCollection<P>,
{
prepare_command(self, cmd("PUNSUBSCRIBE").arg(patterns))
}
/// Unsubscribes the client from the given shard channels, or from all of them if none is given.
///
/// # See Also
/// [<https://redis.io/commands/sunsubscribe//>](https://redis.io/commands/sunsubscribe//)
fn sunsubscribe<C, CC>(&mut self, shardchannels: CC) -> PreparedCommand<Self, ()>
where
Self: Sized,
C: Into<CommandArg>,
CC: SingleArgOrCollection<C>,
{
prepare_command(self, cmd("SUNSUBSCRIBE").arg(shardchannels))
}
/// Unsubscribes the client from the given channels, or from all of them if none is given.
///
/// # See Also
/// [<https://redis.io/commands/unsubscribe/>](https://redis.io/commands/unsubscribe/)
fn unsubscribe<C, CC>(&mut self, channels: CC) -> PreparedCommand<Self, ()>
where
Self: Sized,
C: Into<CommandArg>,
CC: SingleArgOrCollection<C>,
{
prepare_command(self, cmd("UNSUBSCRIBE").arg(channels))
}
}