pub struct Receipt { /* private fields */ }Expand description
A receipt (8.1) that has passed verification steps 1-4: strict JSON, structure, canonical
form and consistency. Its signature has not been checked; use crate::verify.
The members are private and read through getters, so the cached payload
and hash always describe them. A Receipt comes only from
from_json (or from_value for JSON already
parsed) and, with feature sign, from ReceiptBuilder::sign.
Implementations§
Source§impl Receipt
impl Receipt
Sourcepub fn from_json(bytes: &[u8]) -> Result<Receipt>
pub fn from_json(bytes: &[u8]) -> Result<Receipt>
Parses a receipt and runs verification steps 1-4 (10.1).
Sourcepub fn from_value(v: &Value) -> Result<Receipt>
pub fn from_value(v: &Value) -> Result<Receipt>
Runs verification steps 2-4 on a parsed JSON value.
Sourcepub fn payload(&self) -> &[u8] ⓘ
pub fn payload(&self) -> &[u8] ⓘ
The signed payload: canonical bytes of the receipt without sig (8.3).
Sourcepub fn computed_by(&self) -> &str
pub fn computed_by(&self) -> &str
<host>#<key id> of the signing key.
Sourcepub fn signer_host(&self) -> &str
pub fn signer_host(&self) -> &str
The host of computed_by.
Trait Implementations§
impl Eq for Receipt
impl StructuralPartialEq for Receipt
Auto Trait Implementations§
impl Freeze for Receipt
impl RefUnwindSafe for Receipt
impl Send for Receipt
impl Sync for Receipt
impl Unpin for Receipt
impl UnsafeUnpin for Receipt
impl UnwindSafe for Receipt
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