pub enum RaftState {
Follower,
Candidate,
Leader,
}Expand description
The three states a Raft node can be in
Variants§
Follower
Follower state - responds to RPCs from leaders and candidates
Candidate
Candidate state - attempts to become leader
Leader
Leader state - handles client requests and replicates log
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RaftState
impl<'de> Deserialize<'de> for RaftState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for RaftState
impl Eq for RaftState
impl StructuralPartialEq for RaftState
Auto Trait Implementations§
impl Freeze for RaftState
impl RefUnwindSafe for RaftState
impl Send for RaftState
impl Sync for RaftState
impl Unpin for RaftState
impl UnwindSafe for RaftState
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