pub struct Receipt {
pub id: String,
pub timestamp: DateTime<Utc>,
pub agent: String,
pub dat: String,
pub action: ActionDetails,
pub context: Option<ReceiptContext>,
pub chain: ChainLink,
pub signature: String,
}Expand description
A single action receipt in the hash chain.
Fields§
§id: StringUnique receipt identifier.
timestamp: DateTime<Utc>Timestamp of the action.
agent: StringAgent DID that performed the action.
dat: StringDAT JTI that authorized the action.
action: ActionDetailsAction details.
context: Option<ReceiptContext>Optional context.
chain: ChainLinkHash chain linkage.
signature: StringAgent’s signature over this receipt.
Implementations§
Source§impl Receipt
impl Receipt
Sourcepub fn signing_payload_bytes(&self) -> Vec<u8> ⓘ
pub fn signing_payload_bytes(&self) -> Vec<u8> ⓘ
Returns the canonical signing payload bytes (excludes signature field).
This is the data that is (or should be) signed to produce self.signature,
and the data used as input to compute_hash().
Sourcepub fn compute_hash(&self) -> String
pub fn compute_hash(&self) -> String
Compute the BLAKE3 hash of this receipt (for chain linking).
Uses signing_payload_bytes() (i.e., excludes the signature field)
so the hash is stable regardless of whether the receipt is signed yet.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Receipt
impl<'de> Deserialize<'de> for Receipt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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