Crates.io | elsa |
lib.rs | elsa |
version | 1.10.0 |
source | src |
created_at | 2018-12-21 00:32:11.041152 |
updated_at | 2023-12-19 17:06:30.114637 |
description | Append-only collections for Rust where borrows to entries can outlive insertions |
homepage | |
repository | https://github.com/manishearth/elsa |
max_upload_size | |
id | 103016 |
size | 105,857 |
🎵 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.
cargo test --examples --features indexmap