Expand description
JSON utilities with optional SIMD acceleration
This module provides JSON parsing and serialization utilities that can use
SIMD-accelerated parsing when the simd-json feature is enabled.
§Performance
When the simd-json feature is enabled, JSON parsing can be 2-4x faster
for large payloads. This is particularly beneficial for API servers that
handle large JSON request bodies.
§Usage
The module provides drop-in replacements for serde_json functions:
ⓘ
use rustapi_core::json;
// Deserialize from bytes (uses simd-json if available)
let value: MyStruct = json::from_slice(&bytes)?;
// Serialize to bytes
let bytes = json::to_vec(&value)?;Enums§
- Json
Error - JSON error type that wraps both serde_json and simd-json errors.
Functions§
- from_
slice - Deserialize JSON from a byte slice.
- from_
slice_ mut - Deserialize JSON from a mutable byte slice.
- to_vec
- Serialize a value to a JSON byte vector.
- to_
vec_ pretty - Serialize a value to a pretty-printed JSON byte vector.
- to_
vec_ with_ capacity - Serialize a value to a JSON byte vector with pre-allocated capacity.