pub struct LeaseToken {
pub token_id: String,
pub lease_name: String,
pub resource_ref: String,
pub acquired_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub on_expire: String,
}Expand description
A single-use capability over a resource, valid only while τ is in the
[acquired_at, expires_at) window. The token is effectively frozen —
extension is implemented by minting a new token and revoking the old,
preserving the linearity invariant.
Fields§
§token_id: String§lease_name: String§resource_ref: String§acquired_at: DateTime<Utc>§expires_at: DateTime<Utc>§on_expire: StringImplementations§
Source§impl LeaseToken
impl LeaseToken
Sourcepub fn envelope(&self, now: DateTime<Utc>) -> LambdaEnvelope
pub fn envelope(&self, now: DateTime<Utc>) -> LambdaEnvelope
Current ΛD envelope — c decays to 0.0 when τ expires.
Sourcepub fn remaining_seconds(&self, now: DateTime<Utc>) -> f64
pub fn remaining_seconds(&self, now: DateTime<Utc>) -> f64
Remaining window in seconds (0 if already expired).
Trait Implementations§
Source§impl Clone for LeaseToken
impl Clone for LeaseToken
Source§fn clone(&self) -> LeaseToken
fn clone(&self) -> LeaseToken
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 LeaseToken
impl Debug for LeaseToken
impl Eq for LeaseToken
Source§impl Hash for LeaseToken
impl Hash for LeaseToken
Source§impl PartialEq for LeaseToken
impl PartialEq for LeaseToken
Source§fn eq(&self, other: &LeaseToken) -> bool
fn eq(&self, other: &LeaseToken) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LeaseToken
Auto Trait Implementations§
impl Freeze for LeaseToken
impl RefUnwindSafe for LeaseToken
impl Send for LeaseToken
impl Sync for LeaseToken
impl Unpin for LeaseToken
impl UnsafeUnpin for LeaseToken
impl UnwindSafe for LeaseToken
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.