pub struct Lease {
pub effect_id: EffectId,
pub owner: WorkerId,
pub epoch: u64,
pub expires_at: SystemTime,
}Expand description
Proof of holding an effect’s execution lease.
Every acquisition increments the record’s lease epoch. A store accepts a
lease only while the record still carries its owner and epoch and it has
not expired. That fences off a worker whose lease was taken over: all its
later writes fail with StoreError::LeaseLost.
Fields§
§effect_id: EffectIdThe effect the lease is for.
owner: WorkerIdThe holder.
epoch: u64The fencing token.
expires_at: SystemTimeWhen the lease lapses unless renewed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lease
impl<'de> Deserialize<'de> for Lease
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Lease, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Lease, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Lease
Source§impl Serialize for Lease
impl Serialize for Lease
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Lease
Auto Trait Implementations§
impl Freeze for Lease
impl RefUnwindSafe for Lease
impl Send for Lease
impl Sync for Lease
impl Unpin for Lease
impl UnsafeUnpin for Lease
impl UnwindSafe for Lease
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