#frozen #cache #arena #map #borrow

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

#41 in Data structures

Download history 20756/week @ 2023-12-23 24490/week @ 2023-12-30 30658/week @ 2024-01-06 27678/week @ 2024-01-13 29901/week @ 2024-01-20 33134/week @ 2024-01-27 39911/week @ 2024-02-03 39388/week @ 2024-02-10 37022/week @ 2024-02-17 40491/week @ 2024-02-24 41271/week @ 2024-03-02 40139/week @ 2024-03-09 38343/week @ 2024-03-16 42489/week @ 2024-03-23 42496/week @ 2024-03-30 35727/week @ 2024-04-06

165,513 downloads per month
Used in 73 crates (33 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