pub enum ConsensusState {
Follower,
Candidate,
Leader,
}
Expand description
Consensus modules can be in one of three state:
Follower
- which replicates AppendEntries requests and votes for it’s leader.Leader
- which leads the cluster by serving incoming requests, ensuring data is replicated, and issuing heartbeats.Candidate
- which campaigns in an election and may become aLeader
(if it gets enough votes) or aFollower
, if it hears from aLeader
.
Variants§
Trait Implementations§
Source§impl Clone for ConsensusState
impl Clone for ConsensusState
Source§fn clone(&self) -> ConsensusState
fn clone(&self) -> ConsensusState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConsensusState
impl Debug for ConsensusState
Source§impl PartialEq for ConsensusState
impl PartialEq for ConsensusState
impl Eq for ConsensusState
impl StructuralPartialEq for ConsensusState
Auto Trait Implementations§
impl Freeze for ConsensusState
impl RefUnwindSafe for ConsensusState
impl Send for ConsensusState
impl Sync for ConsensusState
impl Unpin for ConsensusState
impl UnwindSafe for ConsensusState
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