pub enum ElectionResult {
Leader(LeaderState),
Follower(Option<LeaderState>),
}Expand description
Result of an election cycle
Returned by run_election_cycle to indicate whether this process
is the leader or a follower.
Variants§
Leader(LeaderState)
This process is the leader
Follower(Option<LeaderState>)
This process is a follower
Contains the current leader state if one exists.
Implementations§
Source§impl ElectionResult
impl ElectionResult
Sourcepub fn leader_state(&self) -> Option<&LeaderState>
pub fn leader_state(&self) -> Option<&LeaderState>
Get the leader state, regardless of whether we are leader or follower
Trait Implementations§
Source§impl Clone for ElectionResult
impl Clone for ElectionResult
Source§fn clone(&self) -> ElectionResult
fn clone(&self) -> ElectionResult
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 moreAuto Trait Implementations§
impl Freeze for ElectionResult
impl RefUnwindSafe for ElectionResult
impl Send for ElectionResult
impl Sync for ElectionResult
impl Unpin for ElectionResult
impl UnwindSafe for ElectionResult
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