pub trait ContentHash {
// Required method
fn hash(&self, state: &mut impl DigestUpdate);
}Expand description
Portable, stable hashing suitable for identifying values
Variable-length sequences should hash a 64-bit little-endian representation
of their length, then their elements in order. Unordered containers should
order their elements according to their Ord implementation. Enums should
hash a 32-bit little-endian encoding of the ordinal number of the enum
variant, then the variant’s fields in lexical order.
Structs can implement ContentHash by using #[derive(ContentHash)].
Required Methods§
Sourcefn hash(&self, state: &mut impl DigestUpdate)
fn hash(&self, state: &mut impl DigestUpdate)
Update the hasher state with this object’s content
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.