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
// Copyright Proa Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
//! Const-only JSON serialization and parsing runtime helpers.
//!
//! This crate pairs with the `ConstJson` derive macro to generate
//! fully `const fn` JSON serialization with zero heap allocation.
//!
//! It also provides compile-time JSON parsing via `const fn`.
/// Serialize literal JSON at compile time, returning a compact `&'static str`.
///
/// Supports objects, arrays, strings, JSON numbers, booleans, and null. Object
/// keys must be string literals. Runtime expressions and duplicate keys are
/// rejected; use `ConstJson` or a runtime serializer for typed values instead.
/// Rust raw strings, comments, and trailing commas are accepted in the input.
/// Object key order depends on the serializer configuration.
/// Integers must fit `i64`/`u64`; floating-point literals must fit finite `f64`.
///
/// ```
/// use const_json::const_json;
/// const SCHEMA: &str = const_json!({"required": ["name"]});
/// assert_eq!(SCHEMA, r#"{"required":["name"]}"#);
/// ```
///
/// ```compile_fail
/// let name = "runtime";
/// let json = const_json::const_json!({"name": name});
/// ```
pub use const_json;
pub use ConstJson;
pub use JsonBuffer;
pub use ;
extern crate std;