pub struct Digest(/* private fields */);Expand description
A domain-separated BLAKE3 digest encoded as 64 lowercase hexadecimal bytes.
Implementations§
Source§impl Digest
impl Digest
Sourcepub fn of_bytes(domain: &str, bytes: &[u8]) -> Digest
pub fn of_bytes(domain: &str, bytes: &[u8]) -> Digest
Hashes bytes under an explicit domain separator.
Sourcepub fn of_serializable<T>(domain: &str, value: &T) -> Result<Digest, CoreError>
pub fn of_serializable<T>(domain: &str, value: &T) -> Result<Digest, CoreError>
Hashes a serializable contract using deterministic JSON bytes.
Contract maps should use ordered collections. Changing a serialized shape is an identity and compatibility change.
§Errors
Returns an error when the value cannot be serialized.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Digest
impl<'de> Deserialize<'de> for Digest
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Digest, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Digest, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Digest
Source§impl Ord for Digest
impl Ord for Digest
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Digest
impl PartialOrd for Digest
Source§impl Serialize for Digest
impl Serialize for Digest
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Digest
Auto Trait Implementations§
impl Freeze for Digest
impl RefUnwindSafe for Digest
impl Send for Digest
impl Sync for Digest
impl Unpin for Digest
impl UnsafeUnpin for Digest
impl UnwindSafe for Digest
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