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§

source

fn type_hash(hasher: &mut impl Hasher)

Accumulate type information in hasher.

Provided Methods§

source

fn type_hash_val(&self, hasher: &mut impl Hasher)

Call TypeHash::type_hash on a value.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TypeHash for bool

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for char

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for f32

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for f64

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for i8

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for i16

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for i32

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for i64

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for i128

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for isize

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for str

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for u8

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for u16

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for u32

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for u64

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for u128

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for ()

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for usize

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for Box<str>

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for String

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for DefaultHasher

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroI8

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroI16

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroI32

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroI64

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroI128

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroIsize

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroU8

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroU16

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroU32

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroU64

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroU128

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl TypeHash for NonZeroUsize

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T0: TypeHash, T1: TypeHash, T2: TypeHash, T3: TypeHash, T4: TypeHash, T5: TypeHash, T6: TypeHash, T7: TypeHash, T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T1: TypeHash, T2: TypeHash, T3: TypeHash, T4: TypeHash, T5: TypeHash, T6: TypeHash, T7: TypeHash, T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T2: TypeHash, T3: TypeHash, T4: TypeHash, T5: TypeHash, T6: TypeHash, T7: TypeHash, T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T3: TypeHash, T4: TypeHash, T5: TypeHash, T6: TypeHash, T7: TypeHash, T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T3, T4, T5, T6, T7, T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T4: TypeHash, T5: TypeHash, T6: TypeHash, T7: TypeHash, T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T4, T5, T6, T7, T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T5: TypeHash, T6: TypeHash, T7: TypeHash, T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T5, T6, T7, T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T6: TypeHash, T7: TypeHash, T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T6, T7, T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T7: TypeHash, T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T7, T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T8: TypeHash, T9: TypeHash, T10: TypeHash> TypeHash for (T8, T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T9: TypeHash, T10: TypeHash> TypeHash for (T9, T10)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T10: TypeHash> TypeHash for (T10,)

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T: TypeHash> TypeHash for Option<T>

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T: TypeHash> TypeHash for [T]

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T: TypeHash> TypeHash for Box<[T]>

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T: TypeHash> TypeHash for Vec<T>

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T: TypeHash, const N: usize> TypeHash for [T; N]

source§

fn type_hash(hasher: &mut impl Hasher)

source§

impl<T: ?Sized + TypeHash> TypeHash for PhantomData<T>

source§

fn type_hash(hasher: &mut impl Hasher)

Implementors§