pub mod bounded_lru;
pub mod growth_slack;
pub mod pass_aged;
pub mod perfect_map;
pub mod rare;
mod word_hash;
pub use word_hash::WordHasher;
#[cfg(not(target_pointer_width = "32"))]
pub type FixedState = foldhash::fast::FixedState;
#[cfg(target_pointer_width = "32")]
pub type FixedState = std::hash::BuildHasherDefault<WordHasher>;
#[cfg(not(target_pointer_width = "32"))]
const FIXED_STATE: FixedState = foldhash::fast::FixedState::with_seed(0);
#[cfg(target_pointer_width = "32")]
const FIXED_STATE: FixedState = std::hash::BuildHasherDefault::new();
#[expect(clippy::disallowed_types, reason = "the alias names its hasher")]
pub type FixedHashMap<K, V> = std::collections::HashMap<K, V, FixedState>;
#[expect(clippy::disallowed_types, reason = "the alias names its hasher")]
pub type FixedHashSet<K> = std::collections::HashSet<K, FixedState>;
pub const fn fixed_hash_map<K, V>() -> FixedHashMap<K, V> {
FixedHashMap::with_hasher(FIXED_STATE)
}
pub const fn fixed_hash_set<K>() -> FixedHashSet<K> {
FixedHashSet::with_hasher(FIXED_STATE)
}
#[cfg(feature = "std-hash")]
pub mod map {
#[expect(
clippy::disallowed_types,
reason = "the std-hash feature asks for std's hasher"
)]
pub use std::collections::{
HashMap, HashSet,
hash_map::{Entry, RandomState},
};
}
#[cfg(all(not(feature = "std-hash"), not(target_pointer_width = "32")))]
pub mod map {
pub use std::collections::hash_map::Entry;
pub use foldhash::{HashMap, HashSet, fast::RandomState};
}
#[cfg(all(not(feature = "std-hash"), target_pointer_width = "32"))]
pub mod map {
pub use std::collections::hash_map::Entry;
pub type RandomState = std::hash::BuildHasherDefault<super::WordHasher>;
#[expect(clippy::disallowed_types, reason = "the alias names its hasher")]
pub type HashMap<K, V> = std::collections::HashMap<K, V, RandomState>;
#[expect(clippy::disallowed_types, reason = "the alias names its hasher")]
pub type HashSet<K> = std::collections::HashSet<K, RandomState>;
}