ustr
ustr copied to clipboard
Possible to create multiple independent caches?
Problem
By only providing a global cache, the "address spaces" of any two different (serializable) data structures relying on Ustr
will be wed. The only way to actually use the serialization feature in a coherent way is to keep your string "cache" (more like a database when serialized AND centralized/global) in its own file, and consider it coupled with any other transactions on data structures storing Ustr
.
Solution
Allow for users to create their own Bins
or something. I'd like to be able to have isolated Bins
, and serialize them next to the data structures that depend on them; as it was mentioned in the README, string-interner
has this ability. If it's important that you are using lazy_static
with a static
variable, maybe use once_cell
in the public API instead.