pub struct LeaseRegistry { /* private fields */ }Expand description
Resume-eligibility ledger. Holds (snapshot_lsn → opened_at_ms, ttl_ms) so a resume request can be checked against TTL without
trusting the wall clock on the client. The shim slice does not
implement true MVCC pinning — the registry’s role is to make
snapshot_expired deterministic and testable.
Implementations§
Source§impl LeaseRegistry
impl LeaseRegistry
pub fn new() -> Arc<LeaseRegistry> ⓘ
Sourcepub fn record(&self, snapshot_lsn: u64, opened_at_ms: u64, ttl_ms: u64)
pub fn record(&self, snapshot_lsn: u64, opened_at_ms: u64, ttl_ms: u64)
Record a freshly-opened lease. Idempotent — re-inserting the same snapshot_lsn refreshes the timestamp (the client cannot observe lease identity through the snapshot LSN alone, so this matches “the latest open wins” semantics).
Sourcepub fn lookup(&self, snapshot_lsn: u64, now_ms: u64) -> LeaseLookup
pub fn lookup(&self, snapshot_lsn: u64, now_ms: u64) -> LeaseLookup
Resume-time lookup. Returns whether the lease is unknown,
expired, or still live as of now_ms.
Trait Implementations§
Source§impl Debug for LeaseRegistry
impl Debug for LeaseRegistry
Source§impl Default for LeaseRegistry
impl Default for LeaseRegistry
Source§fn default() -> LeaseRegistry
fn default() -> LeaseRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for LeaseRegistry
impl RefUnwindSafe for LeaseRegistry
impl Send for LeaseRegistry
impl Sync for LeaseRegistry
impl Unpin for LeaseRegistry
impl UnsafeUnpin for LeaseRegistry
impl UnwindSafe for LeaseRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request