Skip to main content

ReceiptDeadlines

Struct ReceiptDeadlines 

Source
pub struct ReceiptDeadlines { /* private fields */ }
Expand description

Checked receipt and provenance deadlines derived from one admitted clock read.

Construction widens the monotonic u64 clock and both validated u64 TTLs to u128 before addition. The provenance deadline therefore cannot precede the receipt deadline, and neither addition can overflow.

Implementations§

Source§

impl ReceiptDeadlines

Source

pub fn try_from_ttls( now_ms: u64, attach_receipt_ttl_ms: u64, receipt_provenance_ttl_ms: u64, ) -> Result<Self, ReceiptDeadlineError>

Validates TTLs in frozen configuration precedence and derives deadlines.

A zero receipt TTL precedes a zero provenance TTL, which precedes the provenance-order check.

§Errors

Returns ReceiptDeadlineError for the first zero TTL in frozen configuration order or when provenance is shorter than the receipt.

Source

pub const fn try_from_absolute( receipt_expires_at: u128, provenance_expires_at: u128, ) -> Result<Self, ReceiptDeadlineError>

Validates an absolute durable receipt/provenance deadline pair.

Storage persists the checked results rather than the clock reading that derived them, so replay recovers the same typed pair without inventing a synthetic clock.

§Errors

Returns ReceiptDeadlineError::ZeroAbsoluteReceiptDeadline for a zero receipt deadline or ReceiptDeadlineError::AbsoluteProvenanceBeforeReceipt when provenance precedes it.

Source

pub const fn receipt_expires_at(self) -> u128

Returns the checked monotonic receipt deadline.

Source

pub const fn provenance_expires_at(self) -> u128

Returns the checked monotonic provenance deadline.

Trait Implementations§

Source§

impl Clone for ReceiptDeadlines

Source§

fn clone(&self) -> ReceiptDeadlines

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ReceiptDeadlines

Source§

impl Debug for ReceiptDeadlines

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ReceiptDeadlines

Source§

impl PartialEq for ReceiptDeadlines

Source§

fn eq(&self, other: &ReceiptDeadlines) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReceiptDeadlines

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.