#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

#21 in Data structures

Download history 43820/week @ 2024-07-19 51825/week @ 2024-07-26 45255/week @ 2024-08-02 49402/week @ 2024-08-09 52898/week @ 2024-08-16 49205/week @ 2024-08-23 49458/week @ 2024-08-30 52677/week @ 2024-09-06 51104/week @ 2024-09-13 48110/week @ 2024-09-20 50128/week @ 2024-09-27 51226/week @ 2024-10-04 52962/week @ 2024-10-11 54327/week @ 2024-10-18 52599/week @ 2024-10-25 50112/week @ 2024-11-01

219,420 downloads per month
Used in 164 crates (39 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