pub struct NodeContext {
pub server: RedisServer,
pub index: usize,
pub port: u16,
pub total_nodes: u16,
pub masters: u16,
pub replicas_per_master: u16,
}Expand description
Context passed to the per-node configuration callback.
Provides information about the node being configured so the callback can make per-node decisions (e.g., different config for masters vs. replicas, or for a specific node index).
Fields§
§server: RedisServerThe pre-configured RedisServer builder for this node.
All uniform cluster-level settings have already been applied. The callback should modify and return this builder.
index: usizeZero-based index of this node in the cluster.
Nodes are ordered by port: masters occupy indices 0..masters,
replicas occupy indices masters..total.
port: u16The port assigned to this node.
total_nodes: u16Total number of nodes in the cluster.
masters: u16Number of master nodes.
replicas_per_master: u16Number of replicas per master.
Implementations§
Source§impl NodeContext
impl NodeContext
Auto Trait Implementations§
impl Freeze for NodeContext
impl RefUnwindSafe for NodeContext
impl Send for NodeContext
impl Sync for NodeContext
impl Unpin for NodeContext
impl UnsafeUnpin for NodeContext
impl UnwindSafe for NodeContext
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more