pub trait RenewableLease {
// Required methods
fn lease_id(&self) -> u128;
fn expires_at_unix_secs(&self) -> u64;
fn renew(&mut self, duration_secs: u64) -> Result<(), FabricError>;
fn status(&self) -> LeaseStatus;
}Expand description
Uniform interface for renewing a lease regardless of resource type.
Implementors wrap a concrete grafos-std lease type and delegate
lease_id, expires_at_unix_secs, renew, and status to the
underlying lease.
Required Methods§
Sourcefn expires_at_unix_secs(&self) -> u64
fn expires_at_unix_secs(&self) -> u64
Returns the unix timestamp (seconds) at which the lease expires.
Sourcefn renew(&mut self, duration_secs: u64) -> Result<(), FabricError>
fn renew(&mut self, duration_secs: u64) -> Result<(), FabricError>
Attempt to renew the lease for duration_secs additional seconds.
Sourcefn status(&self) -> LeaseStatus
fn status(&self) -> LeaseStatus
Query the current lease status.