/// Type alias for a hashmap using the `fx` hash algorithm with [`FxSeededState`]. #[cfg(feature = "std")] pubtype FxHashMapSeed<K, V> = std::collections::HashMap<K, V, FxSeededState>;
/// Type alias for a hashmap using the `fx` hash algorithm with [`FxSeededState`]. #[cfg(feature = "std")] pubtype FxHashSetSeed<V> = std::collections::HashSet<V, FxSeededState>;
/// [`FxSeededState`] is an alternative state for `HashMap` types, allowing to use [`FxHasher`] with a set seed. /// /// ``` /// # use std::collections::HashMap; /// use rustc_hash::FxSeededState; /// /// let mut map = HashMap::with_hasher(FxSeededState::with_seed(12)); /// map.insert(15, 610); /// assert_eq!(map[&15], 610); /// ``` #[derive(Clone)] pubstruct FxSeededState {
seed: usize,
}
impl FxSeededState { /// Constructs a new `FxSeededState` that is initialized with a `seed`. pubconstfn with_seed(seed: usize) -> FxSeededState { Self { seed }
}
}
impl core::hash::BuildHasher for FxSeededState { type Hasher = FxHasher;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.