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
//! datavalue-rs — bump-allocated JSON value type.
//!
//! [`DataValue<'a>`] mirrors the shape of `serde_json::Value`, but every
//! composite payload (string bytes, array elements, object pairs) lives in
//! a [`bumpalo::Bump`] arena. Designed for hot paths where per-value heap
//! allocation is the bottleneck and the same arena handles many values
//! before being reset.
//!
//! ## Quickstart
//!
//! ```
//! use bumpalo::Bump;
//! use datavalue_rs::DataValue;
//!
//! let arena = Bump::new();
//! let v = DataValue::from_str(r#"{"name":"alice","ages":[30,31]}"#, &arena).unwrap();
//! assert_eq!(v["name"].as_str(), Some("alice"));
//! assert_eq!(v["ages"][1].as_i64(), Some(31));
//! ```
pub use NumberValue;
pub use ;
pub use ;
pub use ;
pub use ;
pub use DataValueSeed;