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
//! # TSON - Terse JSON Binary Format
//!
//! A compact binary format for JSON data, designed for microcontrollers and
//! constrained environments.
//!
//! ## Feature flags
//!
//! - `std` (default on) - enables `std::io`-based helpers and the `IoError`
//! variant in `TsonError`. When disabled, the library is `no_std` and only
//! requires the `alloc` crate.
//! - `json` (default on) - enables JSON ↔ TSON compilation via `serde_json`.
//!
//! ## Quick start
//!
//! ```rust
//! # #[cfg(feature = "json")] {
//! let json = r#"{"name":"Alice","age":30}"#;
//! let doc = tson::compile_json(json).unwrap();
//! let bytes = tson::to_bytes(&doc).unwrap();
//! let restored = tson::from_bytes(&bytes).unwrap();
//! let value = tson::decompile_to_value(&restored).unwrap();
//! assert_eq!(value.to_string(), r#"{"age":30,"name":"Alice"}"#);
//! # }
//! ```
extern crate alloc;
// Module declarations (all at root level)
// Core modules — no_std compatible (only require alloc)
// JSON interop - requires serde_json (gated behind `json` feature)
// Root-level re-exports from `tson` module
pub use TsonStreamReader;
pub use ;
pub use ;
// Python bindings (optional, behind `python` feature)
// Node.js bindings (optional, behind `nodejs` feature)
pub use ;