String Pools / Strings Interning
Features
- owned string pools (also reference-counted)
- no_std (but
allocis required) - quick
Deref<str>implementation (one pointer resolution, one comparison, and one pointer increment) - thin [
PoolStr] type
Example: Initiating a fetch from github
# use ;
// no need for mutability, the pool uses atomic operations
let pool = new;
// use Pool::intern(&self, &str) to insert a string slice into the pool
// if the string was already present, that PoolStr will be reused.
let pool_string = pool.intern;
// you can obtain a &str with the Deref implementation
assert_eq!;
// Hash, Eq, Debug, Display are implemented as well.
// you can use Pool::find(&self, &str) to check if the pool contains a string
assert_eq!;
// the empty string doesn't rely on a pool, it's always there
assert_eq!;
Internal Memory Structure (Example)
