Skip to main content

Crate datavalue_rs

Crate datavalue_rs 

Source
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 OwnedDataValue from a JSON-shaped literal.

Structs§

ParseError
Pretty
Wrapper produced by DataValue::pretty / OwnedDataValue::pretty that renders the value as indented JSON via Display.

Enums§

DataValue
Arena-allocated JSON value tree. Mirrors serde_json::Value in shape and access surface, but every composite payload lives in a Bump.
NumberValue
Specialised numeric representation. Integers stay in i64 unless they overflow during arithmetic, in which case the result falls back to f64.
OwnedDataValue
Heap-owned JSON value tree. Variants mirror DataValue one-for-one; no lifetime parameter.
ParseErrorKind

Traits§

OwnedValueIndex
ValueIndex
Sealed-style helper for DataValue::get. Implemented for &str, String, and usize.