pub trait ClusterCommands<'a>: Sized {
Show 28 methods
// Provided methods
fn asking(self) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_addslots<S>(
self,
slots: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_addslotsrange<S>(
self,
slots: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_bumpepoch(
self,
) -> PreparedCommand<'a, Self, ClusterBumpEpochResult> { ... }
fn cluster_count_failure_reports<I>(
self,
node_id: impl Serialize,
) -> PreparedCommand<'a, Self, usize> { ... }
fn cluster_countkeysinslot(
self,
slot: usize,
) -> PreparedCommand<'a, Self, usize> { ... }
fn cluster_delslots<S>(
self,
slots: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_delslotsrange<S>(
self,
slots: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_failover(
self,
option: Option<ClusterFailoverOption>,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_flushslots(self) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_forget<I>(
self,
node_id: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_getkeysinslot(
self,
slot: u16,
count: usize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_info(
self,
slot: u16,
count: usize,
) -> PreparedCommand<'a, Self, ClusterInfo> { ... }
fn cluster_keyslot(
self,
key: impl Serialize,
) -> PreparedCommand<'a, Self, u16> { ... }
fn cluster_links<R: Response>(self) -> PreparedCommand<'a, Self, R> { ... }
fn cluster_meet(
self,
ip: impl Serialize,
port: u16,
cluster_bus_port: Option<u16>,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_myid<R: Response>(self) -> PreparedCommand<'a, Self, R> { ... }
fn cluster_nodes<R: Response>(self) -> PreparedCommand<'a, Self, R> { ... }
fn cluster_replicas<R: Response>(
self,
node_id: impl Serialize,
) -> PreparedCommand<'a, Self, R> { ... }
fn cluster_replicate(
self,
node_id: impl Serialize,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_reset(
self,
reset_type: ClusterResetType,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_saveconfig(self) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_set_config_epoch(
self,
config_epoch: u64,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_setslot(
self,
slot: u16,
subcommand: ClusterSetSlotSubCommand<'_>,
) -> PreparedCommand<'a, Self, ()> { ... }
fn cluster_shards<R: Response>(self) -> PreparedCommand<'a, Self, R> { ... }
fn cluster_slots<R: Response>(self) -> PreparedCommand<'a, Self, R> { ... }
fn readonly(self) -> PreparedCommand<'a, Self, ()> { ... }
fn readwrite(self) -> PreparedCommand<'a, Self, ()> { ... }
}Expand description
A group of Redis commands related to Cluster Management
§See Also
Redis Cluster Management commands Redis cluster specification
Provided Methods§
Sourcefn asking(self) -> PreparedCommand<'a, Self, ()>
fn asking(self) -> PreparedCommand<'a, Self, ()>
When a cluster client receives an -ASK redirect, the ASKING command is sent to the target node followed by the command which was redirected. This is normally done automatically by cluster clients.
§See Also
Sourcefn cluster_addslots<S>(
self,
slots: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn cluster_addslots<S>( self, slots: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
This command is useful in order to modify a node’s view of the cluster configuration.
Specifically it assigns a set of hash slots to the node receiving the command. If the command is successful, the node will map the specified hash slots to itself, and will start broadcasting the new configuration.
§See Also
Sourcefn cluster_addslotsrange<S>(
self,
slots: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn cluster_addslotsrange<S>( self, slots: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
This command is similar to the cluster_addslots
command in that they both assign hash slots to nodes.
The difference between the two commands is that cluster_addslots
takes a list of slots to assign to the node, while this command takes a list of slot ranges
(specified by a tuple containing start and end slots) to assign to the node.
§See Also
Sourcefn cluster_bumpepoch(self) -> PreparedCommand<'a, Self, ClusterBumpEpochResult>
fn cluster_bumpepoch(self) -> PreparedCommand<'a, Self, ClusterBumpEpochResult>
Sourcefn cluster_count_failure_reports<I>(
self,
node_id: impl Serialize,
) -> PreparedCommand<'a, Self, usize>
fn cluster_count_failure_reports<I>( self, node_id: impl Serialize, ) -> PreparedCommand<'a, Self, usize>
Sourcefn cluster_countkeysinslot(
self,
slot: usize,
) -> PreparedCommand<'a, Self, usize>
fn cluster_countkeysinslot( self, slot: usize, ) -> PreparedCommand<'a, Self, usize>
Sourcefn cluster_delslots<S>(
self,
slots: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn cluster_delslots<S>( self, slots: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
In Redis Cluster, each node keeps track of which master is serving a particular hash slot. This command asks a particular Redis Cluster node to forget which master is serving the hash slots specified as arguments.
§See Also
Sourcefn cluster_delslotsrange<S>(
self,
slots: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn cluster_delslotsrange<S>( self, slots: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
This command is similar to the cluster_delslotsrange
command in that they both remove hash slots from the node.
The difference is that cluster_delslotsrange
takes a list of hash slots to remove from the node,
while this command takes a list of slot ranges (specified by a tuple containing start and end slots) to remove from the node.
§See Also
Sourcefn cluster_failover(
self,
option: Option<ClusterFailoverOption>,
) -> PreparedCommand<'a, Self, ()>
fn cluster_failover( self, option: Option<ClusterFailoverOption>, ) -> PreparedCommand<'a, Self, ()>
Sourcefn cluster_flushslots(self) -> PreparedCommand<'a, Self, ()>
fn cluster_flushslots(self) -> PreparedCommand<'a, Self, ()>
Sourcefn cluster_forget<I>(
self,
node_id: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn cluster_forget<I>( self, node_id: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
The command is used in order to remove a node, specified via its node ID, from the set of known nodes of the Redis Cluster node receiving the command. In other words the specified node is removed from the nodes table of the node receiving the command.
§See Also
Sourcefn cluster_getkeysinslot(
self,
slot: u16,
count: usize,
) -> PreparedCommand<'a, Self, ()>
fn cluster_getkeysinslot( self, slot: u16, count: usize, ) -> PreparedCommand<'a, Self, ()>
The command returns an array of keys names stored in the contacted node and hashing to the specified hash slot.
The maximum number of keys to return is specified via the count argument, so that it is possible for the user of this API to batch-processing keys.
§See Also
Sourcefn cluster_info(
self,
slot: u16,
count: usize,
) -> PreparedCommand<'a, Self, ClusterInfo>
fn cluster_info( self, slot: u16, count: usize, ) -> PreparedCommand<'a, Self, ClusterInfo>
Sourcefn cluster_keyslot(self, key: impl Serialize) -> PreparedCommand<'a, Self, u16>
fn cluster_keyslot(self, key: impl Serialize) -> PreparedCommand<'a, Self, u16>
Sourcefn cluster_links<R: Response>(self) -> PreparedCommand<'a, Self, R>
fn cluster_links<R: Response>(self) -> PreparedCommand<'a, Self, R>
Each node in a Redis Cluster maintains a pair of long-lived TCP link with each peer in the cluster:
- One for sending outbound messages towards the peer
- and one for receiving inbound messages from the peer.
This command outputs information of all such peer links as an array, where each array element is a struct that contains attributes and their values for an individual link.
§Return
An array of structs where each struct contains various attributes and their values of a cluster link.
§See Also
Sourcefn cluster_meet(
self,
ip: impl Serialize,
port: u16,
cluster_bus_port: Option<u16>,
) -> PreparedCommand<'a, Self, ()>
fn cluster_meet( self, ip: impl Serialize, port: u16, cluster_bus_port: Option<u16>, ) -> PreparedCommand<'a, Self, ()>
Sourcefn cluster_myid<R: Response>(self) -> PreparedCommand<'a, Self, R>
fn cluster_myid<R: Response>(self) -> PreparedCommand<'a, Self, R>
Sourcefn cluster_nodes<R: Response>(self) -> PreparedCommand<'a, Self, R>
fn cluster_nodes<R: Response>(self) -> PreparedCommand<'a, Self, R>
Each node in a Redis Cluster has its view of the current cluster configuration, given by the set of known nodes, the state of the connection we have with such nodes, their flags, properties and assigned slots, and so forth.
This command provides all this information, that is, the current cluster configuration of the node we are contacting, in a serialization format which happens to be exactly the same as the one used by Redis Cluster itself in order to store on disk the cluster state (however the on disk cluster state has a few additional info appended at the end).
§Return
The serialized cluster configuration. The output of the command is just a space-separated CSV string, where each line represents a node in the cluster.
§See Also
Sourcefn cluster_replicas<R: Response>(
self,
node_id: impl Serialize,
) -> PreparedCommand<'a, Self, R>
fn cluster_replicas<R: Response>( self, node_id: impl Serialize, ) -> PreparedCommand<'a, Self, R>
The command provides a list of replica nodes replicating from the specified master node.
§Return
The command returns data in the same format as cluster_nodes.
§See Also
Sourcefn cluster_replicate(
self,
node_id: impl Serialize,
) -> PreparedCommand<'a, Self, ()>
fn cluster_replicate( self, node_id: impl Serialize, ) -> PreparedCommand<'a, Self, ()>
The command reconfigures a node as a replica of the specified master. If the node receiving the command is an empty master, as a side effect of the command, the node role is changed from master to replica.
§See Also
Sourcefn cluster_reset(
self,
reset_type: ClusterResetType,
) -> PreparedCommand<'a, Self, ()>
fn cluster_reset( self, reset_type: ClusterResetType, ) -> PreparedCommand<'a, Self, ()>
Reset a Redis Cluster node, in a more or less drastic way depending on the reset type, that can be hard or soft.
§See Also
Sourcefn cluster_saveconfig(self) -> PreparedCommand<'a, Self, ()>
fn cluster_saveconfig(self) -> PreparedCommand<'a, Self, ()>
Forces a node to save the nodes.conf configuration on disk.
Before to return the command calls fsync(2) in order to make sure the configuration is flushed on the computer disk.
§See Also
Sourcefn cluster_set_config_epoch(
self,
config_epoch: u64,
) -> PreparedCommand<'a, Self, ()>
fn cluster_set_config_epoch( self, config_epoch: u64, ) -> PreparedCommand<'a, Self, ()>
This command sets a specific config epoch in a fresh node.
§See Also
Sourcefn cluster_setslot(
self,
slot: u16,
subcommand: ClusterSetSlotSubCommand<'_>,
) -> PreparedCommand<'a, Self, ()>
fn cluster_setslot( self, slot: u16, subcommand: ClusterSetSlotSubCommand<'_>, ) -> PreparedCommand<'a, Self, ()>
This command is responsible of changing the state of a hash slot in the receiving node in different ways.
§See Also
Sourcefn cluster_shards<R: Response>(self) -> PreparedCommand<'a, Self, R>
fn cluster_shards<R: Response>(self) -> PreparedCommand<'a, Self, R>
Sourcefn cluster_slots<R: Response>(self) -> PreparedCommand<'a, Self, R>
fn cluster_slots<R: Response>(self) -> PreparedCommand<'a, Self, R>
Sourcefn readonly(self) -> PreparedCommand<'a, Self, ()>
fn readonly(self) -> PreparedCommand<'a, Self, ()>
Enables read queries for a connection to a Redis Cluster replica node.
§See Also
Sourcefn readwrite(self) -> PreparedCommand<'a, Self, ()>
fn readwrite(self) -> PreparedCommand<'a, Self, ()>
Disables read queries for a connection to a Redis Cluster replica node.
§See Also
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.