pub struct Lease {
pub lease_id: String,
pub run_id: String,
pub job_id: Option<String>,
pub leased_by: String,
pub pool_id: String,
pub lease_until: DateTime<Utc>,
pub created_at: DateTime<Utc>,
}Expand description
Lease for a distributed run (exactly-one claim).
Persisted by SchedulerStore backends that track worker
claims separately from the Run row. Used for reclaim and failover
when a worker stops renewing.
Fields§
§lease_id: StringUnique lease row id.
run_id: StringRun this lease protects.
job_id: Option<String>Owning job, when the run was spawned from a schedule.
leased_by: StringWorker or coordinator instance that holds the lease.
pool_id: StringWorker pool that may claim this run.
lease_until: DateTime<Utc>Lease expiry; another worker may reclaim after this instant.
created_at: DateTime<Utc>When the lease row was first created.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Lease
impl<'de> Deserialize<'de> for Lease
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
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