pub struct CompactReceipt { /* private fields */ }Expand description
A decoded 42-byte CompactReceipt.
Construct one from the X-H33-Receipt header bytes with
Self::from_bytes or from the hex-encoded header value with
Self::from_hex.
Implementations§
Source§impl CompactReceipt
impl CompactReceipt
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, VerifierError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, VerifierError>
Parse a receipt from exactly 42 bytes.
Returns VerifierError::InvalidReceiptSize if the slice is the
wrong length, and VerifierError::UnsupportedReceiptVersion
if the first byte is not RECEIPT_VERSION.
Sourcepub fn from_hex(hex_str: &str) -> Result<Self, VerifierError>
pub fn from_hex(hex_str: &str) -> Result<Self, VerifierError>
Parse a receipt from the hex string used in the X-H33-Receipt
HTTP header. The input must be exactly 84 hex characters
(= 42 bytes).
Sourcepub const fn verification_hash(&self) -> &[u8; 32]
pub const fn verification_hash(&self) -> &[u8; 32]
The 32-byte verification hash embedded in the receipt.
Sourcepub const fn verified_at_ms(&self) -> u64
pub const fn verified_at_ms(&self) -> u64
Unix timestamp in milliseconds when the receipt was issued.
Sourcepub const fn flags(&self) -> AlgorithmFlags
pub const fn flags(&self) -> AlgorithmFlags
Typed view of the algorithm flags byte.
Trait Implementations§
Source§impl Clone for CompactReceipt
impl Clone for CompactReceipt
Source§fn clone(&self) -> CompactReceipt
fn clone(&self) -> CompactReceipt
Returns a duplicate of the value. Read more
1.0.0 · 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 CompactReceipt
impl Debug for CompactReceipt
Source§impl PartialEq for CompactReceipt
impl PartialEq for CompactReceipt
impl Eq for CompactReceipt
impl StructuralPartialEq for CompactReceipt
Auto Trait Implementations§
impl Freeze for CompactReceipt
impl RefUnwindSafe for CompactReceipt
impl Send for CompactReceipt
impl Sync for CompactReceipt
impl Unpin for CompactReceipt
impl UnsafeUnpin for CompactReceipt
impl UnwindSafe for CompactReceipt
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