pub struct HostDeliveryLease { /* private fields */ }Expand description
Exclusive, expiring right to deliver one item to one host.
Implementations§
Source§impl HostDeliveryLease
impl HostDeliveryLease
pub const fn new( delivery_id: HostDeliveryId, lease_id: HostDeliveryLeaseId, owner: HostAgentIncarnation, leased_until: OffsetDateTime, ) -> Self
pub const fn delivery_id(&self) -> &HostDeliveryId
Sourcepub const fn lease_id(&self) -> &HostDeliveryLeaseId
pub const fn lease_id(&self) -> &HostDeliveryLeaseId
The fencing token: a replaced holder cannot commit or clear.
pub const fn owner(&self) -> &HostAgentIncarnation
pub const fn leased_until(&self) -> OffsetDateTime
Sourcepub fn is_live_at(&self, now: OffsetDateTime) -> bool
pub fn is_live_at(&self, now: OffsetDateTime) -> bool
Whether this lease still excludes another holder at now.
Trait Implementations§
Source§impl Clone for HostDeliveryLease
impl Clone for HostDeliveryLease
Source§impl Debug for HostDeliveryLease
impl Debug for HostDeliveryLease
Source§impl<'de> Deserialize<'de> for HostDeliveryLease
impl<'de> Deserialize<'de> for HostDeliveryLease
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for HostDeliveryLease
Source§impl PartialEq for HostDeliveryLease
impl PartialEq for HostDeliveryLease
Source§impl Serialize for HostDeliveryLease
impl Serialize for HostDeliveryLease
impl StructuralPartialEq for HostDeliveryLease
Auto Trait Implementations§
impl Freeze for HostDeliveryLease
impl RefUnwindSafe for HostDeliveryLease
impl Send for HostDeliveryLease
impl Sync for HostDeliveryLease
impl Unpin for HostDeliveryLease
impl UnsafeUnpin for HostDeliveryLease
impl UnwindSafe for HostDeliveryLease
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