1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Heterogeneous, typed key–value maps for Rust.
//!
//! Each key holds one value of a known type. Values use a compact 16-byte representation;
//! strings, byte slices, and some large types are stored in a per-map arena so reads can
//! return `&str` and `&[u8]` without allocating.
//!
//! # Map types
//!
//! | Type | Keys | When to use |
//! | ---- | ---- | ----------- |
//! | [`VarMap`] | [`Key`] (compile-time hash via [`var!`]) | Fixed names known at compile time |
//! | [`StrVarMap`] | `&str` (FNV-1a at runtime) | Dynamic names from config or user input |
//! | [`struct@EnumVarMap`] | `E: [`EnumVarMapKey`]` | Closed set of keys as an enum |
//!
//! # Usage model
//!
//! VarMap is aimed at **write once, read many** workloads. The arena is append-only:
//! overwriting a key replaces the map entry but does not free a previous arena allocation.
//! Prefer setting each key once, then reading often. Call [`VarMap::clear`], [`StrVarMap::clear`],
//! or [`EnumVarMap::clear`] to reset a map between logical snapshots; `clear` retains allocated
//! capacity for later writes.
//!
//! # Supported values
//!
//! Built-in types: integers, floats, `bool`, `char`, `&str`, `&[u8]`, and IP address types.
//! Strings and byte slices up to 14 bytes are stored inline; longer payloads use the arena.
//!
//! Custom `Copy` types (alignment 1–16) can use `#[derive(VarMapValue)]`.
//!
//! # Examples
//!
//! ```
//! use varmap::StrVarMap;
//!
//! let mut map = StrVarMap::new();
//! map.set("port", 8080u16);
//! map.set("host", "localhost");
//!
//! assert_eq!(map.get_u16("port"), Some(8080));
//! assert_eq!(map.get_str("host"), Some("localhost"));
//! ```
pub use ;
pub use VarMapStoredValue;
pub use ValueKind;
pub use MemAlign;
pub use VarMap;
pub use Key;
pub use StrVarMap;
pub use VarMapValue;
pub use VarMapCustomValue;
pub use EnumVarMapKey;
pub use Value;
pub use ValueBuilder;
pub use *;
pub use EnumVarMap;