Expand description
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, decode,
default, 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.
Re-exports§
pub use canonical::canonicalise;pub use decode::decode;pub use default::of_type as default_of_type;pub use dump::dump;pub use dump_cpp::dump_fastdds;pub use dump_rust::dump_hdds;pub use encode::encode;pub use fill::Vendor;pub use fill::fill;
Modules§
- canonical
- The one form two implementations’ values can be compared in — at
serde_json::Value. - contract
- What a value file means, in one place — at
serde_json::Value. - corba_
cpp - The fill and the dump for the OMG IDL-to-C++ mapping.
- corba_
idl - CORBA IDL for one type, printed from the model.
- corba_
java - The fill and the dump for the OMG IDL-to-Java mapping.
- decode
- The bytes back into the value — at
serde_json::Value. - default
- The value a member takes when the stream does not carry it — at
serde_json::Value. - dump
- The value-printing code a foreign probe needs to answer with.
- dump_
cpp - The value-printing code the Fast DDS probe needs to answer with.
- dump_
ros - The C that prints a
rosidlstructure back as canonical JSON. - dump_
rust - The Rust expression that prints one decoded HDDS sample as JSON.
- encode
- One value, one type, the bytes between them — at
serde_json::Value. - fill
- The value-filling code a foreign probe needs.
- fill_
cpp - The value-filling code the Fast DDS probe needs.
- fill_
ros - The C that puts one JSON sample into a
rosidlgenerated structure. - fill_
rust - The Rust expression that builds one sample of an HDDS-generated type.
- matrix
- The configuration matrix every column is measured over, and the Rust column’s answers under it.
- recursion
- The aggregates of a type graph that sit on a cycle.
- ros_idl
- A
rosidlinterface package for one type, printed from the model. - target_
keywords - The identifiers a target language will not let a generator paste through, and what each generator renames them to.
- value
- What a probe is asked for.
Structs§
- Difference
- One place two values disagree.
- Probe
Request - One probe run.
Enums§
- Emit
- What the probe writes out.
- Probe
Error - Why a probe could not produce bytes.
Constants§
- EXACT_
JSON_ INTEGER - The largest integer a JSON number carries without loss.
- REFUSED_
BY_ THE_ FRONT_ END - The corpus cases the IDL front end refuses, so that no walk over
tests/interop-corpus/gets a model for them.