Module sync

Source
Expand description

A thread-safe variant of the interner. Also provides a global interner (when the global feature is enabled), which comes with a free function intern, as well as an intern method for a few string types.

Structs§

GlobalInternerglobal
A global Interner, just for convenience.
Interner
An interner will keep track of strings and ensure there is only one allocation for any given string contents.
IntoIter
An owning iterator over the strings that were in an Interner.
Iter
An iterator over the strings in a LockedInterner.
LockedInterner
A locked Interner. This struct is created by Interner::lock; see its documentation for more details.

Traits§

InternExtglobal
An “extension trait” to add a the intern method to str, which effectively adds it to all types that directly or transitively implement Deref<Target = str>, which includes String, references, and smart pointers to str or String.

Functions§

internglobal
Locks the GlobalInterner, saves the given string if it is not already saved, and returns the saved string, or blocks until it is able to do so.

Type Aliases§

InternedStr
The type of strings that have been interned.