IDL 4.2 · §7.4.13.4.2

Union

A discriminated union carries exactly one member, selected at runtime by a discriminator of integer, char, boolean or enum type. ZeroDDS validates case-label uniqueness, discriminator coverage and the optional default.

Example

union Command switch (short) {
  case 1: long   set_speed;
  case 2: double set_angle;
  default: string raw;
};

ZeroDDS support

OMG IDL 4.2 section§7.4.13.4.2
Implementationidl-rust/src
Testsunion_validation.rs
Status✓ RC3 — parsed, validated and code-generated across all target languages.

See also: IDL construct coverage · idl-4.2 audit · OMG IDL 4.2 spec