pub struct Receipt {
pub asof: String,
pub cell: Cell,
pub computed_by: String,
pub inputs: Vec<String>,
pub issued: String,
pub licence: String,
pub publisher: String,
pub sig: String,
pub summary: String,
pub tx: String,
pub value: Scalar,
pub valid: Args,
/* 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.
Fields§
§asof: StringThe transaction time answered as of.
cell: CellThe cell answered (no slices).
computed_by: String<host>#<key id> of the signing key.
inputs: Vec<String>Receipt hashes of the inputs, ascending.
issued: StringWhen the receipt was signed.
licence: StringAn SPDX identifier or an https URL.
publisher: StringThe namespace that owns the function; equals cell.ns.
sig: StringThe Ed25519 signature, 128 lowercase hex digits.
summary: StringOne human sentence.
tx: StringWhen the value was recorded.
value: ScalarThe value, typed.
valid: ArgsThe valid-time arguments, echoed from cell.args.
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 signer_host(&self) -> &str
pub fn signer_host(&self) -> &str
The host of computed_by.