Skip to main content

qubit_json/
lib.rs

1// =============================================================================
2//    Copyright (c) 2025 - 2026 Haixing Hu.
3//
4//    SPDX-License-Identifier: Apache-2.0
5//
6//    Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! Resource-aware JSON infrastructure organized into decoding, encoding, and
9//! materialized-value domains.
10//!
11//! * [`decode`] validates strict JSON and normalizes explicitly configured
12//!   non-standard text.
13//! * [`encode`] serializes values with explicit output and value budgets.
14//! * [`value`] constructs and traverses materialized JSON values.
15//!
16//! `qubit-budget` owns limits, resource identities, and sessions. This crate
17//! owns JSON-specific normalization, syntax validation, value construction,
18//! and traversal.
19//!
20//! # Number contract
21//!
22//! Strict text codecs accept negative integers in `i64`, non-negative
23//! integers in `u64`, and fractional or exponential tokens representable as
24//! finite `f64`. This intentionally includes integers above JavaScript's safe
25//! integer limit. Wider exact integers and exact decimals must use strings or
26//! an explicit domain wire format. `NumberBytes` limits lexical size; it does
27//! not expand the supported numeric range.
28
29#![deny(missing_docs)]
30
31pub mod decode;
32pub mod encode;
33mod internal;
34mod lexical;
35pub mod value;