pub enum Role {
Follower,
PreCandidate,
Candidate,
Leader,
}Expand description
The role a node currently plays in its term.
Variants§
Follower
Passive; redirects clients and waits for heartbeats.
PreCandidate
Running a pre-vote round (no term bump yet) to avoid disrupting a live leader (Raft thesis §9.6).
Candidate
Seeking votes for a new term.
Leader
Elected; replicates the log and serves clients.
Trait Implementations§
impl Copy for Role
impl Eq for Role
impl StructuralPartialEq for Role
Auto Trait Implementations§
impl Freeze for Role
impl RefUnwindSafe for Role
impl Send for Role
impl Sync for Role
impl Unpin for Role
impl UnsafeUnpin for Role
impl UnwindSafe for Role
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