pub enum NodeType {
Electable,
Monitor,
Secondary,
Arbiter,
}Expand description
The type of a node within a replication group.
Each node type determines what role the node can play in the group, whether it participates in elections, and whether it stores data.
Variants§
Electable
An electable node that can serve as either master or replica. Electable nodes participate in elections and store a complete copy of the data.
Monitor
A monitor node that observes group state changes but does not participate in elections or store data. Monitors receive notifications about master changes and group membership.
Secondary
A secondary node that replicates data from the master but cannot be elected master. Secondary nodes do not participate in elections or contribute to quorum calculations.
Arbiter
An arbiter node used for tie-breaking in elections. Arbiters participate in elections and acknowledge transactions but do not store a full copy of the data.
Implementations§
Source§impl NodeType
impl NodeType
Sourcepub fn is_electable(&self) -> bool
pub fn is_electable(&self) -> bool
Returns true if this node type can participate in elections.
Electable nodes and arbiters participate in elections.
Sourcepub fn is_data_node(&self) -> bool
pub fn is_data_node(&self) -> bool
Returns true if this node type stores a full copy of the data.
Electable and secondary nodes are data nodes.
Sourcepub fn can_be_master(&self) -> bool
pub fn can_be_master(&self) -> bool
Returns true if this node type can become master.
Only electable nodes can become master.
Trait Implementations§
impl Copy for NodeType
impl Eq for NodeType
impl StructuralPartialEq for NodeType
Auto Trait Implementations§
impl Freeze for NodeType
impl RefUnwindSafe for NodeType
impl Send for NodeType
impl Sync for NodeType
impl Unpin for NodeType
impl UnsafeUnpin for NodeType
impl UnwindSafe for NodeType
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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