pub enum KeyHolderNesting {
Recursive,
KeylessNestedWhole,
}Expand description
How far Step 1’s member removal reaches into a key holder.
XTypes 1.3 §7.6.8 Step 1 keeps the key members of the holder —
If there are any key members, then remove the non-key members from FooKeyHolder. Otherwise do not remove any members.
— and Step 3 says to “apply steps 1 and 2 recursively to the members
of FooKeyHolder if they are themselves AggregatedTypes”. FooKeyHolder
at that point is whatever Step 1 left, so for a keyless aggregate it
is every member, and Step 3 applies to all of them. The recursion has
no depth limit written into it.
§What the vendors do
Measured on 2026-08-09 through keyhash-probe/ — Cyclone DDS
11.0.1, RTI Connext 7.7.0, Fast DDS from source. Three shapes:
@final struct NestedNoKey { long a; long b; };
@final struct OuterKeylessNested { @key NestedNoKey inner; long tail; };
@final struct DeepLeaf { @key long p; long q; };
@final struct DeepMid { DeepLeaf leaf; long r; }; // no key of its own
@final struct DeepOuter { @key DeepMid mid; long tail; };
@final struct ChainLeaf { @key long p; long q; };
@final struct ChainMid { @key ChainLeaf inner; long r; };
@final struct ChainOuter { @key ChainMid mid; long tail; };All three vendors, under every encoding, give OuterKeylessNested
both of NestedNoKey’s members and ChainOuter only p — so the
“otherwise do not remove any members” clause holds, and the recursion
through keyed levels is unlimited everywhere.
They part over DeepOuter, where a keyless level sits above a keyed
one:
DeepOuter holder | |
|---|---|
| Cyclone, XCDR1 and XCDR2 | 0d0d0d0d 0f0f0f0f — p and r |
| Fast DDS | the same |
| RTI, XCDR2 | the same |
| RTI, XCDR1 | 0d0d0d0d 0e0e0e0e 0f0f0f0f — p, q and r |
RTI’s XCDR1 holder stops filtering at the first keyless aggregate and
takes what is under it whole: maxSizeSerializedKey V1 / V2 reports
12 / 8 for that type, so the two holders are genuinely different
types and not one type serialized twice.
Variants§
Recursive
Step 1 applies at every level, however deep. The clause, and what four of the five measured combinations do.
KeylessNestedWhole
The first keyless aggregate is taken whole; nothing below it is filtered.
RTI Connext 7.7 under XCDR1. Under XCDR2 RTI recurses like
everyone else, which is why Dialect::key_holder_nesting takes
the encoding.
Implementations§
Source§impl KeyHolderNesting
impl KeyHolderNesting
Sourcepub const fn is_default(self) -> bool
pub const fn is_default(self) -> bool
Whether this is the default.