Expand description
Yet another string interning library.
The main thing that makes this library different is that
InternedString stores the hash of the string, which makes
using it in lookups is really fast, especially when using nohash_hasher::IntMap.
The hash is assumed to be perfect, which means this library accepts the risk of hash collisions!
The interned strings are never freed, so don’t intern too many things.
Modules§
Macros§
- declare_
new_ type - Declare a newtype wrapper around
InternedStringwith all the convenience methods you would want. - declare_
new_ type_ nonempty - Like
declare_new_type!, but the string is validated. - intern_
static - Intern a string literal once and return the cached value on subsequent calls.
- intern_
static_ nonempty - Like
intern_static!, but for types declared viadeclare_new_type_nonempty!.