| Crates.io | hcstatic-str |
| lib.rs | hcstatic-str |
| version | 0.1.2 |
| created_at | 2023-06-20 21:19:57.278435+00 |
| updated_at | 2024-12-31 20:50:45.880468+00 |
| description | compact storage for short static strings |
| homepage | |
| repository | |
| max_upload_size | |
| id | 895499 |
| size | 6,595 |
This crate is for storing static short strings (up to 256 bytes) in as compact a way as possible. Instead of each string getting it's own allocation, and associated padding, header, etc, they are stored packed into 1 MiB allocations. The length is stored in the allocation, making the stack size of the Str type 1 word instead of the usual 2 for &str. Because the length is limited to 256 bytes only one extra byte is used in the heap allocation for the length.