| 1 | //! _🎵 Immutability never bothered me anyway 🎶_ |
| 2 | //! |
| 3 | //! This crate provides various "Frozen" collections. |
| 4 | //! |
| 5 | //! These are append-only collections where references to entries can be held |
| 6 | //! on to even across insertions. This is safe because these collections only |
| 7 | //! support storing data that's present behind some indirection -- i.e. `String`, |
| 8 | //! `Vec<T>`, `Box<T>`, etc, and they only yield references to the data behind the |
| 9 | //! allocation (`&str`, `&[T]`, and `&T` respectively) |
| 10 | //! |
| 11 | //! The typical use case is having a global cache of strings or other data which the rest of the program borrows from. |
| 12 | |
| 13 | pub mod map; |
| 14 | pub mod vec; |
| 15 | |
| 16 | #[cfg (feature = "indexmap" )] |
| 17 | pub mod index_map; |
| 18 | #[cfg (feature = "indexmap" )] |
| 19 | pub mod index_set; |
| 20 | |
| 21 | pub mod sync; |
| 22 | |
| 23 | pub use map::{FrozenBTreeMap, FrozenMap}; |
| 24 | pub use vec::FrozenVec; |
| 25 | |
| 26 | #[cfg (feature = "indexmap" )] |
| 27 | pub use index_map::FrozenIndexMap; |
| 28 | #[cfg (feature = "indexmap" )] |
| 29 | pub use index_set::FrozenIndexSet; |
| 30 | |