pub enum CollectionDelimiterPolicy {
Specification,
EnumIsPrimitive,
Never,
}Expand description
Which collections carry a DHEADER under XCDR2.
XTypes 1.3 §7.4.3.5 rules (8) through (13): a collection of a primitive element type serialises identically under both versions, and every other collection is delimited under XCDR2. §7.2.2.2 lists the primitive types; an enumeration is a constructed type under §7.2.2.4.1 and is therefore not one.
§The three implementations disagree
Measured on 2026-08-09, XCDR2 little-endian, payload bytes:
| element type | Cyclone | RTI 7.7 | Fast DDS |
|---|---|---|---|
@final struct Cell, Cell items[2] | 20 | 16 | 20 |
@final struct Cell, sequence<Cell> | 24 | 20 | 24 |
@appendable struct, sequence<> | 32 | 28 | 32 |
enum Colour, Colour cs[2] | 12 | 8 | 8 |
enum Colour, sequence<Colour> | 16 | 12 | 12 |
The runs are in tests/fixtures/vendor_bytes.md. Only Cyclone
matches the specification on every row.
Changing this changes the bytes on the wire. Unlike the length-code policy, a conforming reader cannot absorb the difference: there is no flag in the stream saying whether the four bytes it is looking at are a delimiter or the first element.
Variants§
Specification
Delimit every collection whose element type is not primitive, enumerations included.
The default, because it is what §7.4.3.5 says and what Cyclone DDS emits.
EnumIsPrimitive
Treat an enumeration as if it were primitive, and delimit the rest.
What Fast DDS emits. Select it to interoperate with a Fast DDS peer over a topic whose type has an enum collection.
Never
Never delimit a collection, whatever its element type.
What RTI Connext 7.7 emits. Element-level delimiters an
@appendable element type calls for are still written; this
policy is only about the collection’s own.
Implementations§
Source§impl CollectionDelimiterPolicy
impl CollectionDelimiterPolicy
Sourcepub const fn is_default(self) -> bool
pub const fn is_default(self) -> bool
Whether this is the default.