Skip to main content

Crate zerodds_wire_probe

Crate zerodds_wire_probe 

Source
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.

IDLJSON
booleantrue / false
integers up to 32 bitsnumber
long long, unsigned long longstring — a JSON number loses precision past 2^53
float, double, long doublenumber, written round-trip exact
char, wcharone-character string
string, wstringstring
fixed<P, S>string — a decimal, "123.45", because a JSON number is a double
enumthe enumerator’s name, as a string
bitmaskarray of the set bit names
bitsetobject, keyed by bitfield name, each an integer
structureobject, keyed by member name
sequence, arrayarray
map<K, V>array of two-element arrays — a JSON object keys on a string, and K need not be one
unionobject with _d and the selected member
@optional absentthe 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 rosidl structure 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 rosidl generated 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 rosidl interface 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.
ProbeRequest
One probe run.

Enums§

Emit
What the probe writes out.
ProbeError
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.