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
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 ZeroDDS Contributors
//! Crate `zerodds-wire-probe`. Safety classification: **SAFE**.
//!
//! One IDL type plus one JSON value, in; the bytes that type takes on
//! the wire, out. This is the ZeroDDS side of the interop suite —
//! `docs/specs/zerodds-interop-suite-1.0.md`.
//!
//! ## Why it is reflective and not generated
//!
//! A probe that went through the code generator would test the
//! generator. This one walks the model and the layout plan directly, so
//! a difference between it and a foreign implementation is a difference
//! in what the plan says, which is the thing under test. The generated
//! path is tested separately, by `zerodds-wire-conformance`.
//!
//! ## The value format
//!
//! One JSON document per sample, read against the type rather than
//! against a Rust struct, so an unknown field or a missing member is an
//! error naming the path rather than a silent default.
//!
//! | IDL | JSON |
//! |---|---|
//! | `boolean` | `true` / `false` |
//! | integers up to 32 bits | number |
//! | `long long`, `unsigned long long` | **string** — a JSON number loses precision past 2^53 |
//! | `float`, `double`, `long double` | number, written round-trip exact |
//! | `char`, `wchar` | one-character string |
//! | `string`, `wstring` | string |
//! | `fixed<P, S>` | **string** — a decimal, `"123.45"`, because a JSON number is a double |
//! | `enum` | the enumerator's name, as a string |
//! | `bitmask` | array of the set bit names |
//! | `bitset` | object, keyed by bitfield name, each an integer |
//! | structure | object, keyed by member name |
//! | `sequence`, array | array |
//! | `map<K, V>` | **array of two-element arrays** — a JSON object keys on a string, and `K` need not be one |
//! | `union` | object with `_d` and the selected member |
//! | `@optional` absent | the key is left out — `null` is an error |
//!
//! ## Layer position
//!
//! A tool over `zerodds-wire-codec`, which is the plan executor itself
//! and knows nothing about JSON. What is here is the probe: the value
//! file's representation (`json`), the front end that turns IDL text
//! into a model, and the five foreign-column emitters — C for Cyclone
//! and RTI, C++ for Fast DDS, C for the ROS type supports, and the three
//! CORBA columns.
//!
//! The engine modules below — [`canonical`], [`contract`], [`mod@decode`],
//! [`default`], [`mod@encode`], [`value`] — are that crate's, pinned to
//! `serde_json::Value`. Nothing is re-derived here: the wrappers forward
//! and the signatures are the ones every call site already had.
/// The corpus cases the IDL front end refuses, so that no walk over
/// `tests/interop-corpus/` gets a model for them.
///
/// Both are in the corpus deliberately, and both have a README saying
/// every implementation must refuse the file. What changed is *where*
/// the refusal happens: it used to arrive at the layout plan or at the
/// value contract, with a model in hand; `zerodds_idl_compose` carries
/// the two clauses now, so `model_from_idl` answers `Err` and there is
/// no model to walk.
///
/// - `recursive-array` — `struct Node { long value; Node pair[2]; }`.
/// A cycle with nothing on it that terminates a value: an array's
/// element count is fixed and non-zero, so no value of the type is
/// finite. IDL 4.2 §7.4.1.4.4.4.4.
/// - `resolve-module-named-as-type` — `module common { struct common
/// { … }; }`. IDL 4.2 §7.5.2 does not admit a name redefined within
/// the immediate scope of the construct that carries it, and prints
/// `module M { typedef short M; }` as its own `// Error` example. The
/// case measures which vendors refuse the file and which resolve it
/// anyway.
///
/// `tools/idlc/tests/corpus.rs` carries both as `Intended` diagnostics,
/// with the same two clauses.
///
/// A list and never a pattern: a case that stops being refused is as
/// much a finding as one that starts, and each walk that reads this
/// asserts the refusal it skips actually happened.
pub const REFUSED_BY_THE_FRONT_END: = ;
pub use ;
pub use decode;
pub use of_type as default_of_type;
pub use dump;
pub use dump_fastdds;
pub use dump_hdds;
pub use ;
pub use ;
pub use ;
pub use EXACT_JSON_INTEGER;