Skip to content

Struct envelope::BodyHash

zaun_community_protocol::envelope::BodyHash · Struct

pub struct BodyHash(…)

SHA3-256 of a command’s body JSON text exactly as received: reformatting the same JSON gives a different hash, which is why retries must resend byte-identical bodies.

pub fn of(body: &RawValue) -> Self

Hashes a received body.

pub fn of_text(text: &str) -> Self

Hashes body JSON text.

pub const fn from_bytes(bytes: [u8; 32]) -> Self

Wraps a stored hash.

pub const fn as_bytes(&self) -> &[u8; 32]

The digest bytes, for storage.

Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

Full rustdoc page