Expand description
What a value file means, in one place.
Three backends read the same value file: crate::encode() turns it
into bytes, zerodds_wire_probe::fill into C for Cyclone and RTI,
and zerodds_wire_probe::fill_cpp into C++ for Fast DDS. Every
question about the file — is this key a member, may it be null, is
this integer expressible, which members does this aggregate have —
has to be answered the same way by all three, because a difference is
a difference in the sample and the matrix would read it as a
difference in the serialisers.
The two backends that are not here still call these functions: the
rules are generic over Source and every one of them is
monomorphised at the same serde_json::Value the encoder uses. A
backend that lived in a different crate and re-derived the rules
would be back where defect 11 was.
They agreed once by inspection and diverged twice by edit. Defect 11
of docs/silent-drop-sweep.md is one half of that divergence: the C
emitter walked members_of where the other two walked
all_members_of, so a derived type’s base members were never filled
and the vendor serialised a structure of the right length with zeros
in it. Nothing said so, because each backend held its own copy of the
rule.
So the rules live here and the backends call them. A rule that is only in one backend is a rule the other two can contradict.
§What is recorded
Sharing the decisions is half of it; the other half is checking that
the backends actually reach the same parts of the value. Each backend
threads a Consumed and pushes the path of every scalar it
reads out of the document. Two backends that accept the same file and
consumed different paths disagree about what the sample is, whatever
their exit codes said. tests/probe_agreement.rs is what compares
them.
Structs§
- Case
- One case member of a union.
- Consumed
- Where each backend read a scalar out of the value document.
- Member
- One member of an aggregate, as all three backends see it.
- Unevaluated
Label - A case label whose constant expression the model cannot evaluate.
Constants§
- MAX_
ALIAS_ HOPS - How many typedefs one chain may hop through before it is taken for a cycle.
Functions§
- array
- An array.
- array_
dimensions - The element counts of an array’s dimensions.
- bit_
names - The bit names a bitmask value sets, each with its position.
- bitfield_
names - The names of a bitset’s own bitfields, anonymous padding excluded.
- boolean
trueorfalse.- bounded_
items - The elements of a collection, with its declared bound enforced.
- character
- Exactly one character.
- character_
for - Exactly one character, of a width that can carry it.
- discriminator
- A union’s discriminator value, which is never absent.
- discriminator_
c_ width - How a union’s
switchand itscaselabels have to be spelled in C and C++. - enumerator
- The enumerator a value names, and its effective value.
- float
- A floating-point value.
- float128
- A
long double. - integer
- An integer, in whatever spelling the representation admits.
- integer_
for - An integer that fits the primitive it is destined for.
- join
<path>.<name>, or<name>at the root of a nameless walk.- kind_of
- The kind a value has, for a refusal that says what was there.
- map_
entry - The key and the value of one map entry.
- member_
value - The value for one member, or
Nonewhere an@optionalis absent. - members
- Every member an aggregate has, a base’s before its own.
- object
- An object.
- reject_
alias_ cycle - Refuse a model whose typedefs close a cycle, before any walk follows one.
- reject_
null - Refuse
nullwherever a value belongs. - reject_
unknown_ keys - Refuse a key that names nothing the type declares.
- resolve_
alias - Whether
type_is one of the two aggregates a JSON object stands for, once typedefs are seen through. - root_
path - The path the root of a value document is named by.
- text
- A string.
- union_
cases - A union’s case members, in case order.
- union_
members - A union’s members, by name, in case order.
- union_
selection - The case a discriminator value selects, under
zerodds_ast_layout::UnionLabelMatch.