pub struct LeaseRecord {
pub lease_id: u64,
pub holder: Vec<u8>,
pub holder_epoch: u64,
pub ttl_ms: u64,
pub ts_upper_bound: u64,
pub expires_at_ms: u64,
pub superseded: bool,
}Expand description
Durable lease state.
lease_id is the acquire-time ts_upper_bound (a committed-high-water
value); strict monotonicity of the durable high-water makes it unique across
grants, epochs, and failovers.
Fields§
§lease_id: u64§holder: Vec<u8>Opaque holder-group key (1..=MAX_LEASE_HOLDER_LEN bytes); compared only for byte equality.
holder_epoch: u64Supersede ordering within a holder group.
ttl_ms: u64Acquire-time TTL, re-armed verbatim by every renewal.
ts_upper_bound: u64Highest physical_ms the holder may stamp. Always a value the durable high-water has reached.
expires_at_ms: u64Server-clock expiry; the lease stops counting toward the safe frontier
at now_ms >= expires_at_ms.
superseded: boolTrue once a higher-epoch acquire for the same holder group landed.
Implementations§
Source§impl LeaseRecord
impl LeaseRecord
pub fn is_expired(&self, now_ms: u64) -> bool
Trait Implementations§
Source§impl Clone for LeaseRecord
impl Clone for LeaseRecord
Source§fn clone(&self) -> LeaseRecord
fn clone(&self) -> LeaseRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LeaseRecord
impl Debug for LeaseRecord
impl Eq for LeaseRecord
Source§impl PartialEq for LeaseRecord
impl PartialEq for LeaseRecord
Source§fn eq(&self, other: &LeaseRecord) -> bool
fn eq(&self, other: &LeaseRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LeaseRecord
Auto Trait Implementations§
impl Freeze for LeaseRecord
impl RefUnwindSafe for LeaseRecord
impl Send for LeaseRecord
impl Sync for LeaseRecord
impl Unpin for LeaseRecord
impl UnsafeUnpin for LeaseRecord
impl UnwindSafe for LeaseRecord
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