0.3.2 Aug 23, 2022
0.3.1 Aug 13, 2022
0.2.1 Jul 22, 2022
0.1.6 Jul 5, 2022
0.1.4 May 23, 2022

#91 in #symbol

Download history 3/week @ 2024-04-08 9/week @ 2024-04-15 14/week @ 2024-04-22 14/week @ 2024-04-29 6/week @ 2024-05-06 13/week @ 2024-05-13 20/week @ 2024-05-20 4/week @ 2024-05-27 10/week @ 2024-06-03 11/week @ 2024-06-10 41/week @ 2024-06-17 10/week @ 2024-06-24 10/week @ 2024-07-01 2/week @ 2024-07-08 10/week @ 2024-07-15 27/week @ 2024-07-22

51 downloads per month
Used in 155 crates (15 directly)

Apache-2.0

14KB
178 lines

A global, uniqued cache of strings that is never purged. Inspired by servo/string-cache.

This module provides storage for strings that are meant to remain in use for the entire running duration of a program. Strings that are stored in this global, static cache are never evicted, and so the memory consumed by them can only ever grow.

The strings can be accessed via the Symbol type, which acts as a pointer to the underlying string data.

NOTE: If you're looking for a #[forbid(unsafe_code)] attribute here, you won't find one: symbol-pool (and its inspiration, servo/string-cache) uses unsafe Rust in order to store and dereference Symbol pointers to strings.

Dependencies

~0.4–1MB
~23K SLoC