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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! The named parse limit sets of spec 002, 3.2.5. Each document type uses
//! exactly one of them through [`crate::Document::LIMITS`].
use crateParseLimits;
const KIB: usize = 1024;
const MIB: usize = 1024 * KIB;
/// Decision definitions.
pub const DEFINITION_V1: ParseLimits = ParseLimits ;
/// Context snapshots.
pub const SNAPSHOT_V1: ParseLimits = ParseLimits ;
/// Backend descriptors and calibration artifacts.
pub const DESCRIPTOR_V1: ParseLimits = ParseLimits ;
/// Backend outputs; masses, logits and scores are JSON numbers.
pub const BACKEND_OUTPUT_V1: ParseLimits = ParseLimits ;
/// Compiled plans.
pub const PLAN_V1: ParseLimits = ParseLimits ;
/// Judgments, evidence records and evaluation reports.
pub const RECORD_V1: ParseLimits = ParseLimits ;
/// Replay bundles and eval-owned documents (spec 004, 3.2 and 3.5).
pub const REPLAY_V1: ParseLimits = ParseLimits ;
/// Request identity documents: `REPLAY_V1` tightened to 4 MiB (spec 004,
/// 3.4.2). The projection inside still obeys the plan's own bound.
pub const REQUEST_V1: ParseLimits = ParseLimits ;
/// The `rustev.remote/1` documents (spec 009, 3.10): descriptors inside a
/// describe answer, projections as strings, outputs as JSON numbers. A
/// transport also bounds what it reads by the negotiated maximum.
pub const REMOTE_V1: ParseLimits = ParseLimits ;
/// Exchange records, `rustev.remote-exchange/1` (spec 009, 3.9.1): a fixed
/// maximum size, with free text cut to 256 bytes before escaping.
pub const EXCHANGE_V1: ParseLimits = ParseLimits ;
/// Dynamic questions, `rustev.dynamic-question/1` (spec 019, 3.2): the
/// request's own bounds (128 KiB canonical, 64 KiB of context values) are
/// checked after this scan; the scan admits at most twice the canonical
/// bound in raw bytes, so whitespace and escapes cannot force an unbounded
/// allocation.
pub const DYNAMIC_QUESTION_V1: ParseLimits = ParseLimits ;
/// Span lines, `rustev.trace/1` (spec 028, 3.10.1): at most 64 KiB per
/// line. An attribute value is at most 4 096 bytes before escaping, so a
/// string's raw length is bounded at six times that.
pub const TRACE_V1: ParseLimits = ParseLimits ;