1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * SPDX-FileCopyrightText: 2023 Tommaso Fontana
 *
 * SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
 */

//! Implementation of traits for struts from the std library
use crate::prelude::*;
use core::hash::Hash;
use std::collections::hash_map::DefaultHasher;

impl TypeHash for DefaultHasher {
    fn type_hash(hasher: &mut impl core::hash::Hasher) {
        "std::hash::DefaultHasher".hash(hasher);
    }
}

impl ReprHash for DefaultHasher {
    fn repr_hash(hasher: &mut impl core::hash::Hasher, offset_of: &mut usize) {
        crate::traits::std_repr_hash::<Self>(hasher, offset_of)
    }
}

impl MaxSizeOf for DefaultHasher {
    fn max_size_of() -> usize {
        core::mem::size_of::<Self>()
    }
}