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
impl ReceiptDeadlines
Sourcepub fn try_from_ttls(
now_ms: u64,
attach_receipt_ttl_ms: u64,
receipt_provenance_ttl_ms: u64,
) -> Result<Self, ReceiptDeadlineError>
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.
Sourcepub const fn try_from_absolute(
receipt_expires_at: u128,
provenance_expires_at: u128,
) -> Result<Self, ReceiptDeadlineError>
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.
Sourcepub const fn receipt_expires_at(self) -> u128
pub const fn receipt_expires_at(self) -> u128
Returns the checked monotonic receipt deadline.
Sourcepub const fn provenance_expires_at(self) -> u128
pub const fn provenance_expires_at(self) -> u128
Returns the checked monotonic provenance deadline.
Trait Implementations§
Source§impl Clone for ReceiptDeadlines
impl Clone for ReceiptDeadlines
Source§fn clone(&self) -> ReceiptDeadlines
fn clone(&self) -> ReceiptDeadlines
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more