pub struct ClusterNode {
pub index: usize,
pub container_name: String,
pub host_port: u16,
pub role: NodeRole,
}Expand description
A deterministic handle to a single node in a RedisClusterTemplate.
Returned by RedisClusterTemplate::node. The fields are derived purely
from the template configuration (the {name}-node-{index} naming contract,
the port base, and the master/replica split applied by
redis-cli --cluster create), so constructing a handle is free and does not
require the cluster to be running. This makes it suitable for targeted fault
injection: pause, partition, or kill exactly the container you name.
Fields§
§index: usizeZero-based index of the node within the cluster.
container_name: StringContainer name, following the {name}-node-{index} contract.
host_port: u16Host port mapped to this node’s Redis port (port_base + index).
role: NodeRoleRole assigned to the node at cluster-create time.
This is the static assignment (0..num_masters are masters, the rest are
replicas), not necessarily the live role after a failover. Use
RedisClusterTemplate::node_role to read the current role from a
running node.
Trait Implementations§
Source§impl Clone for ClusterNode
impl Clone for ClusterNode
Source§fn clone(&self) -> ClusterNode
fn clone(&self) -> ClusterNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClusterNode
impl Debug for ClusterNode
impl Eq for ClusterNode
Source§impl PartialEq for ClusterNode
impl PartialEq for ClusterNode
Source§fn eq(&self, other: &ClusterNode) -> bool
fn eq(&self, other: &ClusterNode) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ClusterNode
Auto Trait Implementations§
impl Freeze for ClusterNode
impl RefUnwindSafe for ClusterNode
impl Send for ClusterNode
impl Sync for ClusterNode
impl Unpin for ClusterNode
impl UnsafeUnpin for ClusterNode
impl UnwindSafe for ClusterNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.