pub struct Leadership { /* private fields */ }Expand description
The exact durable owner record a caller may attempt to renew before local expiry.
It is caller-local evidence, not a lease granted by a durable clock: a poll must still verify the participant, rank, and persisted duration against durable state. A later successful leader poll, including renewal by this same participant, supersedes this token’s fencing rank.
Implementations§
Source§impl Leadership
impl Leadership
Sourcepub fn participant(&self) -> &ParticipantId
pub fn participant(&self) -> &ParticipantId
Returns the process incarnation this token identifies as owner.
A renewal attempt additionally requires this to match the participant
passed to super::LeaderElection::poll.
Sourcepub fn rank(&self) -> Rank
pub fn rank(&self) -> Rank
Returns this token’s durable revision as a fencing rank.
A later successful leader poll supersedes this rank, including renewal by the same participant.
Sourcepub fn lease_duration(&self) -> Duration
pub fn lease_duration(&self) -> Duration
Returns the lease duration persisted with this token.
It bounds local renewability from Self::last_renewed_at, not the
durable owner’s lifetime.
Sourcepub fn last_renewed_at(&self) -> Duration
pub fn last_renewed_at(&self) -> Duration
Returns the caller-clock time supplied at the successful poll attempt’s start.
A renewal is locally eligible only while elapsed time from this value is
less than Self::lease_duration. It must be compared only with the
same caller’s monotonic clock.
Trait Implementations§
Source§impl Clone for Leadership
impl Clone for Leadership
Source§fn clone(&self) -> Leadership
fn clone(&self) -> Leadership
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more