#string-cache #frozen #arena #map #borrow #reference-data

elsa

Append-only collections for Rust where borrows to entries can outlive insertions

17 stable releases

1.10.0 Dec 19, 2023
1.9.0 Aug 10, 2023
1.8.1 Apr 5, 2023
1.8.0 Feb 20, 2023
0.1.3 Dec 28, 2018

#25 in Data structures

Download history 50475/week @ 2024-08-22 47787/week @ 2024-08-29 51169/week @ 2024-09-05 55616/week @ 2024-09-12 44083/week @ 2024-09-19 52227/week @ 2024-09-26 50584/week @ 2024-10-03 53754/week @ 2024-10-10 53139/week @ 2024-10-17 53351/week @ 2024-10-24 50315/week @ 2024-10-31 50080/week @ 2024-11-07 47729/week @ 2024-11-14 46330/week @ 2024-11-21 49130/week @ 2024-11-28 39000/week @ 2024-12-05

191,174 downloads per month
Used in 187 crates (43 directly)

MIT/Apache

85KB
1.5K SLoC

elsa

Build Status Current Version License: MIT/Apache-2.0

🎵 Immutability never bothered me anyway 🎶

This crate provides various "frozen" collections.

These are append-only collections where references to entries can be held on to even across insertions. This is safe because these collections only support storing data that's present behind some indirection -- i.e. String, Vec<T>, Box<T>, etc, and they only yield references to the data behind the allocation (&str, &[T], and &T respectively)

The typical use case is having a global cache of strings or other data which the rest of the program borrows from.

Running all examples

cargo test --examples --features indexmap

lib.rs:

🎵 Immutability never bothered me anyway 🎶

This crate provides various "Frozen" collections.

These are append-only collections where references to entries can be held on to even across insertions. This is safe because these collections only support storing data that's present behind some indirection -- i.e. String, Vec<T>, Box<T>, etc, and they only yield references to the data behind the allocation (&str, &[T], and &T respectively)

The typical use case is having a global cache of strings or other data which the rest of the program borrows from.

Dependencies

~175KB