Struct arc_string_interner::StringInterner [−][src]
pub struct StringInterner<S, H, const N: usize> where
S: Symbol,
H: BuildHasher, { /* fields omitted */ }Expand description
Caches strings efficiently, with minimal memory footprint and associates them with unique symbols. These symbols allow constant time comparisons and look-ups to the underlying interned strings.
Implementations
Creates a new StringInterner with the given initial capacity.
Index in arena from Sym
Shard index from Sym
Creates a new empty StringInterner with the given hasher.
Creates a new empty StringInterner with the given initial capacity and the given hasher.
Interns the given value.
Returns a symbol to access it within this interner.
This either copies the contents of the string (e.g. for str) or moves them into this interner (e.g. for String).
Returns the string slice associated with the given symbol if available,
otherwise returns None.
Returns the symbol associated with the given string for this interner
if existent, otherwise returns None.
Returns the number of uniquely interned strings within this interner.
Shrinks the capacity of the interner as much as possible.