pub struct GraceServed { /* private fields */ }Expand description
A lease a caller has already challenged and waited the hand-over grace out on, in the shape that survives a trip out to a host and back: the owner token as the number its hex spells, and the heartbeat that token had not moved past.
It is a claim, not a proof. DirLock::acquire takes the caller’s word that
the grace_ms of a ChallengeOutcome::GraceOwed really elapsed and only re-checks that the lease is
still the same one — a caller that skips its own wait reclaims a lock its holder was owed
notice on. What it can never do is reclaim a different lease, or two callers reclaim one.
Implementations§
Source§impl GraceServed
impl GraceServed
Sourcepub fn of(holder: &LockHolder) -> Option<GraceServed>
pub fn of(holder: &LockHolder) -> Option<GraceServed>
The token for the holder a ChallengeOutcome::GraceOwed named.
@param holder the holder that outcome carried, unchanged
@returns the token, or None for an owner this engine did not mint — a lock file nobody
can name is never reclaimed on a caller’s word
Sourcepub fn parse(owner: &str, heartbeat_at: i64) -> Option<GraceServed>
pub fn parse(owner: &str, heartbeat_at: i64) -> Option<GraceServed>
As GraceServed::of, from the two members alone, for a host that carries them back out
of its own refusal envelope rather than holding a LockHolder.
@param owner the holder’s owner token, as the lock file spells it
@param heartbeat_at the holder’s heartbeat_at, unchanged
@returns the token, or None when owner is not one this engine minted
Trait Implementations§
Source§impl Clone for GraceServed
impl Clone for GraceServed
Source§fn clone(&self) -> GraceServed
fn clone(&self) -> GraceServed
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GraceServed
Source§impl Debug for GraceServed
impl Debug for GraceServed
impl Eq for GraceServed
Source§impl PartialEq for GraceServed
impl PartialEq for GraceServed
impl StructuralPartialEq for GraceServed
Auto Trait Implementations§
impl Freeze for GraceServed
impl RefUnwindSafe for GraceServed
impl Send for GraceServed
impl Sync for GraceServed
impl Unpin for GraceServed
impl UnsafeUnpin for GraceServed
impl UnwindSafe for GraceServed
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.