parry3d/utils/deterministic_state.rs
1use core::hash::BuildHasher;
2use std::collections::hash_map::DefaultHasher;
3
4/// A hasher builder that creates `DefaultHasher` with default keys.
5#[derive(Default)]
6pub struct DeterministicState;
7
8impl DeterministicState {
9 /// Creates a new `DeterministicState` that builds `DefaultHasher` with default keys.
10 pub fn new() -> DeterministicState {
11 DeterministicState
12 }
13}
14
15impl BuildHasher for DeterministicState {
16 type Hasher = DefaultHasher;
17
18 fn build_hasher(&self) -> DefaultHasher {
19 DefaultHasher::new()
20 }
21}