pub enum KeyHolderExtensibility {
ForcedFinal,
AsDeclared,
}Expand description
Whether a key holder keeps the type’s extensibility or is forced to
@final.
DDSI-RTPS 2.5 §9.6.4.8 Step 1 and XTypes 1.3 §7.6.8 Step 1 both
build FooKeyHolder from Foo and then say it “shall have
extensibility kind ‘FINAL’”. A holder that kept the original’s kind
carries the original’s framing: a DHEADER for an appendable one,
PID headers and a sentinel for a mutable one under XCDR1 — and that
pushes the holder over sixteen bytes, which sends Step 5 down the
MD5 branch. Two peers reading the clause differently compute
different instance handles for one instance.
§One implementation departs, in one place
Measured with @final struct Foo { @key long id; long x; long y; }
and its @appendable and @mutable variants, id = 0x12345678:
| XCDR1 | XCDR2 | |
|---|---|---|
| Cyclone, all three kinds | holder 12345678, hash 12345678 + zeros | the same |
| Fast DDS, all three | the same | the same |
RTI, @final / @appendable | the same | the same |
RTI, @mutable | holder 00000004 12345678 7f020000, hash 0482916deda7e1d2459197a74346627f | 12345678 + zeros |
Cyclone’s key buffer still carries the framing and
dds_stream_extract_keyBE_from_key(…, DDS_CDR_KEY_SERIALIZATION_KEYHASH, …) strips it. Fast DDS hard-codes PLAIN_CDR2 in the generated
holder whatever the type says. RTI keeps the parameter list under
XCDR1 only: maxSizeSerializedKey V1 = 28, past sixteen, so the MD5
branch is taken over the framing rather than over the key.
Variants§
ForcedFinal
@final, whatever the type declares. The clause, and what four
of the five measured combinations do.
AsDeclared
The type’s own kind, framing and all.
RTI Connext 7.7 under XCDR1. Select it to compute the instance
handle an RTI peer computes for a @mutable keyed type there;
under XCDR2 RTI forces final like everyone else, which is why
Dialect::key_holder_extensibility takes the encoding.
Implementations§
Source§impl KeyHolderExtensibility
impl KeyHolderExtensibility
Sourcepub const fn is_default(self) -> bool
pub const fn is_default(self) -> bool
Whether this is the default.