nphysics3d/utils/deterministic_state.rs
1use std::collections::hash_map::DefaultHasher;
2use std::hash::BuildHasher;
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() -> Self {
11 Self::default()
12 }
13}
14
15impl BuildHasher for DeterministicState {
16 type Hasher = DefaultHasher;
17
18 fn build_hasher(&self) -> DefaultHasher {
19 DefaultHasher::new()
20 }
21}