ncollide3d/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.
5pub struct DeterministicState;
6
7impl DeterministicState {
8    /// Creates a new `DeterministicState` that builds `DefaultHasher` with default keys.
9    pub fn new() -> DeterministicState {
10        DeterministicState
11    }
12}
13
14impl BuildHasher for DeterministicState {
15    type Hasher = DefaultHasher;
16
17    fn build_hasher(&self) -> DefaultHasher {
18        DefaultHasher::new()
19    }
20}