Skip to main content

document_digest

Function document_digest 

Source
pub fn document_digest<P>(doc: &TrustTask<P>) -> Result<DocumentDigest, Error>
where P: Serialize,
Expand description

Compute the SPEC §7.2 item 11 document identity for doc.

Fails only if the payload cannot be serialized to JSON, which for a document that arrived over any transport cannot happen — but a caller-constructed TrustTask<P> over a hand-written Serialize impl can fail, and a guard that silently keyed on a truncated document would be worse than one that refuses.