pub struct ElectionState { /* private fields */ }Expand description
A read-only snapshot of durable state for diagnostics and observability.
It makes no liveness, expiry, or leadership-validity claim. Use
super::LeaderElection::poll with caller-owned LocalState for
protocol decisions instead of deriving authority from this snapshot.
Implementations§
Source§impl ElectionState
impl ElectionState
Sourcepub fn owner(&self) -> Option<&ParticipantId>
pub fn owner(&self) -> Option<&ParticipantId>
Returns the durable owner, if the observed state is not released.
Some does not show whether that owner is running or locally renewable.
Sourcepub fn rank(&self) -> Rank
pub fn rank(&self) -> Rank
Returns the durable revision as a fencing rank.
A rank is retained after resignation so a later acquisition receives a strictly newer fencing epoch.
Sourcepub fn lease_duration(&self) -> Option<Duration>
pub fn lease_duration(&self) -> Option<Duration>
Returns the last persisted lease duration, if this state has been created.
It is historical state, not a persisted expiration deadline.
Trait Implementations§
Source§impl Clone for ElectionState
impl Clone for ElectionState
Source§fn clone(&self) -> ElectionState
fn clone(&self) -> ElectionState
Returns a copy 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 PartialEq for ElectionState
impl PartialEq for ElectionState
impl Eq 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 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