pub enum ElectionState {
Candidate,
Leader,
Follower(Uuid),
}Expand description
The current role of a node in the Raft protocol.
Variants§
Candidate
The node is campaigning for leadership.
Leader
The node is the current cluster leader and accepts writes.
Follower(Uuid)
The node is a follower of the leader identified by the inner Uuid.
A Uuid::nil() means no leader has been elected yet.
Trait Implementations§
Source§impl Clone for ElectionState
impl Clone for ElectionState
Source§fn clone(&self) -> ElectionState
fn clone(&self) -> ElectionState
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 ElectionState
impl Debug for ElectionState
Source§impl<'de> Deserialize<'de> for ElectionState
impl<'de> Deserialize<'de> for ElectionState
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
Source§impl PartialEq for ElectionState
impl PartialEq for ElectionState
Source§impl Serialize for ElectionState
impl Serialize for ElectionState
impl StructuralPartialEq for ElectionState
Auto Trait Implementations§
impl Freeze for ElectionState
impl RefUnwindSafe for ElectionState
impl Send for ElectionState
impl Sync for ElectionState
impl Unpin for ElectionState
impl UnsafeUnpin for ElectionState
impl UnwindSafe for ElectionState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request