Crate hash_str

Source

Macros§

hash_literal
Takes a string literal as input and hashes it, returning a u64 literal.
hstr
Construct a &’static HashStr at compile time. These are presumably deduplicated by the compiler.

Structs§

HashStr
HashStr is a dynamically sized type so it is used similarly to &str. A hash is stored at the beginning followed by a str. The length is known by the fat pointer when in the form &HashStr.
UnhashedStr
Helper type for indexing a HashMap without allocation Unhashed str is hashed on the fly instead of using a precalculated hash. Useful for indexing a HashMap without needing to allocate a Box

Constants§

SIZE_HASH

Traits§

GetHash

Type Aliases§

HashStrMap
A standard HashMap using &HashStr as the key type with a custom Hasher that just uses the precomputed hash for speed instead of calculating it.
HashStrSet
A standard HashSet using &HashStr as the key type with a custom Hasher that just uses the precomputed hash for speed instead of calculating it.