pub struct CacheLease {
pub object_id: CacheObjectId,
pub object_version: u64,
pub lease_id: u64,
pub owner_scope: CacheLeaseOwnerScope,
pub owner_id: u64,
pub granted_at_ms: u64,
pub ttl_ms: u32,
}Fields§
§object_id: CacheObjectId§object_version: u64§lease_id: u64§owner_scope: CacheLeaseOwnerScope§owner_id: u64§granted_at_ms: u64§ttl_ms: u32Implementations§
Source§impl CacheLease
impl CacheLease
pub fn expires_at_ms(&self) -> u64
pub fn is_expired_at(&self, now_ms: u64) -> bool
pub fn validate_live_at( &self, now_ms: u64, ) -> Result<(), CacheValidationFailure>
pub fn validate_version( &self, expected_version: u64, ) -> Result<(), CacheValidationFailure>
Trait Implementations§
Source§impl Clone for CacheLease
impl Clone for CacheLease
Source§fn clone(&self) -> CacheLease
fn clone(&self) -> CacheLease
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 CacheLease
impl Debug for CacheLease
Source§impl PartialEq for CacheLease
impl PartialEq for CacheLease
Source§fn eq(&self, other: &CacheLease) -> bool
fn eq(&self, other: &CacheLease) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for CacheLease
impl Eq for CacheLease
impl StructuralPartialEq for CacheLease
Auto Trait Implementations§
impl Freeze for CacheLease
impl RefUnwindSafe for CacheLease
impl Send for CacheLease
impl Sync for CacheLease
impl Unpin for CacheLease
impl UnsafeUnpin for CacheLease
impl UnwindSafe for CacheLease
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