pub enum MapDelimiter {
EitherHalf,
ValueOnly,
}Expand description
Which of a map’s two halves decides whether the map carries a
delimiter under XCDR2.
Separate from CollectionDelimiterPolicy because it is a separate
question and one measured implementation answers the two
differently. That policy says which element types exempt a
collection; this says which of a map’s two element types is asked.
§The measurement
tests/interop-results/sources/vendor-corpus.tsv, Fast DDS 3.6.1,
encoding version 2, both byte orders. Little endian, the leading
word of each payload:
| case | the map | Fast DDS writes |
|---|---|---|
map-key-long | map<long, long> | 03000000 — the entry count |
map-key-string | map<string, long> | 03000000 — the entry count |
map-empty | map<string, long> | 00000000 — the entry count |
map-value-string | map<long, string> | 22000000 — a DHEADER |
map-value-struct | map<long, Cell> | 22000000 — a DHEADER |
map-value-sequence | map<long, sequence<long>> | 1c000000 — a DHEADER |
map-nested | map<long, map<long, long>> | 1c000000 — a DHEADER |
A string key exempts nothing and a string value does not,
so the question Fast DDS asks is the value’s alone. Twelve recorded
rows separate the two readings — map-empty, map-key-string and
typedef-of-map in both orders under both of their halves — and
they were the last twelve rows of the Fast DDS column that no single
setting reached.
Variants§
EitherHalf
Either half. Rule (14) of XTypes 1.3 §7.4.3.5.3 exempts a map
only where the key and the value are primitive, so a
map<string, long> is delimited by rule (15).
The default, and the clause’s reading.
ValueOnly
The value alone, whatever the key is. Fast CDR 2.3.5’s.
Implementations§
Source§impl MapDelimiter
impl MapDelimiter
Sourcepub const fn is_default(self) -> bool
pub const fn is_default(self) -> bool
Whether this is the default.