pub struct LostCommitTracker { /* private fields */ }Expand description
The lost-commit detection + backoff schedule (mls-resilience.md § Lost commit): a device that doesn’t see its committed epoch on the chain within the detection timeout re-submits, backing off on each attempt, and after the budget is exhausted surfaces the change to the user (never silently abandoned). Re-submission is idempotent — OpenMLS rejects a duplicate, so a retry that did land is harmless.
Pure timing bookkeeping (no real sleeping) so it is deterministic under test.
Implementations§
Source§impl LostCommitTracker
impl LostCommitTracker
Sourcepub fn new() -> Self
pub fn new() -> Self
A tracker with the defaults (owned here, not in the doc): detection timeout 30 s, backoff 30 s → 2 min → 10 min, 3 attempts.
Sourcepub fn detection_timeout(&self) -> SignedDuration
pub fn detection_timeout(&self) -> SignedDuration
The detection timeout: a committed epoch not reflected on the chain within this is treated as lost.
Sourcepub fn max_attempts(&self) -> u32
pub fn max_attempts(&self) -> u32
The maximum number of re-submission attempts before the change is surfaced to the user.
Sourcepub fn record_attempt(&mut self) -> Option<SignedDuration>
pub fn record_attempt(&mut self) -> Option<SignedDuration>
Record a re-submission attempt; returns the backoff to wait before the next attempt, or
None if the budget is now exhausted (the change must be surfaced to the user).
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Whether the retry budget is exhausted.
Trait Implementations§
Source§impl Clone for LostCommitTracker
impl Clone for LostCommitTracker
Source§fn clone(&self) -> LostCommitTracker
fn clone(&self) -> LostCommitTracker
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LostCommitTracker
impl Debug for LostCommitTracker
Auto Trait Implementations§
impl Freeze for LostCommitTracker
impl RefUnwindSafe for LostCommitTracker
impl Send for LostCommitTracker
impl Sync for LostCommitTracker
impl Unpin for LostCommitTracker
impl UnsafeUnpin for LostCommitTracker
impl UnwindSafe for LostCommitTracker
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more