pub trait TypeHash {
// Required method
fn type_hash(hasher: &mut impl Hasher);
// Provided method
fn type_hash_val(&self, hasher: &mut impl Hasher) { ... }
}
Expand description
Recursively compute a type hash for a type.
TypeHash::type_hash
is a recursive function that computes information
about a type. It is used to
check that the type of the data being deserialized matches
syntactically the type of the data that was written.
The type hasher should store information about the name and the type of the fields of a type, and the name of the type itself.
Required Methods§
Provided Methods§
sourcefn type_hash_val(&self, hasher: &mut impl Hasher)
fn type_hash_val(&self, hasher: &mut impl Hasher)
Call TypeHash::type_hash
on a value.
Object Safety§
This trait is not object safe.