Expand description
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));Modules§
- simd
- Cross-architecture SIMD primitives, exposed as standalone public utilities.
Macros§
- owned_
json - Construct an
OwnedDataValuefrom a JSON-shaped literal.
Structs§
- Parse
Error - Pretty
- Wrapper produced by
DataValue::pretty/OwnedDataValue::prettythat renders the value as indented JSON viaDisplay.
Enums§
- Data
Value - Arena-allocated JSON value tree. Mirrors
serde_json::Valuein shape and access surface, but every composite payload lives in aBump. - Number
Value - Specialised numeric representation. Integers stay in i64 unless they overflow during arithmetic, in which case the result falls back to f64.
- Owned
Data Value - Heap-owned JSON value tree. Variants mirror
DataValueone-for-one; no lifetime parameter. - Parse
Error Kind
Traits§
- Owned
Value Index - Value
Index - Sealed-style helper for
DataValue::get. Implemented for&str,String, andusize.