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
42
43
44
// =============================================================================
// Copyright (c) 2026 Haixing Hu.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0.
// =============================================================================
//! Defines dependency-free resource limits and sessions for JSON processing.
//!
//! Value budgets admit one complete value through a transaction. Staged usage
//! becomes committed only when that transaction succeeds, so a rejected value
//! or unwinding rollback cannot consume structural or payload capacity.
//!
//! A JSON encoder that buffers a complete `Vec<u8>` can charge output only
//! after serialization succeeds. Writer-oriented encoders instead charge every
//! accepted output prefix immediately, so those charges remain after a later
//! error or panic.
//!
//! Decode and encode attempts both retain their immediate I/O charges. They
//! publish staged value accounting only through `commit`; dropping an attempt,
//! including while unwinding, rolls the value state back.
pub use JsonDecodeAttempt;
pub use JsonDecodeLimits;
pub use JsonDecodeLimitsBuilder;
pub use JsonDecodeSession;
pub use JsonEncodeAttempt;
pub use JsonEncodeLimits;
pub use JsonEncodeLimitsBuilder;
pub use JsonEncodeSession;
pub use JsonContainerKind;
pub use JsonMeasurement;
pub use JsonResource;
pub use JsonValueBudget;
pub use JsonValueLimits;
pub use JsonValueLimitsBuilder;
pub use JsonValueTransaction;