Crate str_id

Source
Expand description

Interns str slices, giving you back an ID value.

The ID value is a newtyped NonZeroUsize. You get approximately the same benefits as using Box<Str>, but when the same str is used in multiple locations they’ll resolve to the same ID value.

All str slice data resides in a global cache. There is no way to purge the cache once a str slice has been interned. This library is not intended for long running programs.

Structs§

StrID
This is a newtype over a NonZeroUsize which can get back the str slice used to obtain this ID.

Type Aliases§

StaticStr
An easier name to type because you don’t have to use non-letter characters.