pub struct PollResult { /* private fields */ }Expand description
The result prepared by super::LeaderElection::poll.
Keep this value inside the transaction callback until the enclosing
Database::run succeeds. Before then, the
transaction can retry, be cancelled, or fail to commit. On success, inspect
Self::outcome and consume it with Self::into_next_state to carry
caller-local validity into the next attempt.
Implementations§
Source§impl PollResult
impl PollResult
Sourcepub fn outcome(&self) -> &PollOutcome
pub fn outcome(&self) -> &PollOutcome
Returns the role and fencing rank prepared by this transaction attempt.
See PollOutcome for when the rank is usable for protected work.
Sourcepub fn into_next_state(self, adopted_at: Duration) -> LocalState
pub fn into_next_state(self, adopted_at: Duration) -> LocalState
Consumes this result and returns the caller-local state for the next attempt.
adopted_at must be read from the caller’s monotonic clock after the
enclosing Database::run succeeds. It timestamps only a new or reset
observation; an unchanged observation and leadership token retain their
original attempt-local timestamps.
Trait Implementations§
Source§impl Clone for PollResult
impl Clone for PollResult
Source§fn clone(&self) -> PollResult
fn clone(&self) -> PollResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more