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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//! A minimal JSON pull-parser for resource-constrained environments.
//!
//! `picojson` provides low-level, `no_std` compatible pull-parsers that operate without
//! recursion or heap allocations, designed for embedded systems and memory-limited scenarios.
//!
//! ## Main Types
//!
//! - [`SliceParser`] - Parses JSON from byte slices or strings with zero-copy when possible
//! - [`StreamParser`] - Parses JSON from any [`Reader`] source, buffering as needed
//!
//! Both parsers emit [`Event`]s representing JSON structure and values, allowing fine-grained
//! control over parsing and memory usage.
//!
//! ## Quick Start
//!
//! ```rust
//! use picojson::{SliceParser, Event, String, PullParser};
//!
//! let json = r#"{"name": "value"}"#;
//! let mut parser = SliceParser::new(json);
//!
//! while let Some(event) = parser.next() {
//! match event.expect("Parse error") {
//! Event::Key(key) => println!("Found key: {}", key),
//! _ => {}
//! }
//! }
//! ```
//!
//! ## String Escapes
//!
//! For JSON containing escape sequences (like `\n`, `\"`, `\u0041`), use constructors
//! with scratch buffers to handle unescaping. The buffer must be at least as long
//! as the longest contiguous string or number in your JSON:
//!
//! ```rust
//! # use picojson::SliceParser;
//! let json = r#"{"msg": "Hello\nWorld"}"#;
//! let mut scratch = [0u8; 32];
//! let parser = SliceParser::with_buffer(json, &mut scratch);
//! ```
//!
//! ## More Examples
//!
//! For advanced usage including configurable nesting depth, number parsing options,
//! and stream parsing, see the [examples directory](https://github.com/kaidokert/picojson-rs/tree/main/picojson/examples)
//! on GitHub.
// SPDX-License-Identifier: Apache-2.0
// Compile-time configuration validation
pub use ArrayBitStack;
pub use ArrayBitBucket;
pub use ;
pub use ParseError;
pub use ;
pub use ;
pub use String;
pub use SliceParser;
pub use ;
pub use ChunkReader;
pub use PushParserHandler;
pub use ;