zerodds-cdr-derive

Layer 1 — Primitives. Proc-macro #[derive(DdsType)].

zerodds-cdr-derive is a compile-time codegen for ZeroDDS topic types. Annotate a plain-Rust struct and it emits an impl zerodds_dcps::DdsType that encodes and decodes XCDR2 byte-exact against OMG XTypes 1.3 §7.4 — the same wire form as the idl-rust codegen.

Spec anchors

  • zerodds-xcdr2-rust-1.0 §11.1 — the derive macro as a spec-permitted alternative to the idl-rust codegen.
  • OMG XTypes 1.3 §7.4 — wire format of the emitted encode/decode methods.
  • OMG XTypes 1.3 §7.6.8.4 — key-hash computation (≤ 16 bytes zero-pad, otherwise MD5).

Quick start

use zerodds_cdr_derive::DdsType;

#[derive(DdsType, Clone, PartialEq)]
pub struct Sensor {
    #[dds(key)]
    pub id: i32,
    pub value: f64,
}

Tests

  • crates/cdr-derive/tests/derive_smoke.rs — 6 tests, byte-exact against the V-2 wire vector from zerodds-xcdr2-bindings-conformance-1.0 §6.

Stability

1.0.0-rc.3. The macro output token layout may change between minor versions; semantically the impl DdsType spec form stays the same.

zerodds-cdr-derive

Layer 1 — Primitives. Proc-Macro #[derive(DdsType)].

zerodds-cdr-derive ist ein Compile-Time-Codegen fuer ZeroDDS-Topic-Types. Annotiert einen Plain-Rust-struct und emittiert eine impl zerodds_dcps::DdsType- Implementation, die XCDR2 byte-genau gegen OMG XTypes 1.3 §7.4 encoded und decoded — gleiche Wire-Form wie der idl-rust-Codegen.

Spec-Anker

  • zerodds-xcdr2-rust-1.0 §11.1 — Derive-Macro als spec-zugelassene Alternative zum idl-rust-Codegen.
  • OMG XTypes 1.3 §7.4 — Wire-Format der emittierten encode/decode-Methoden.
  • OMG XTypes 1.3 §7.6.8.4 — Key-Hash-Berechnung (≤ 16 Bytes zero-pad, sonst MD5).

Quick Start

use zerodds_cdr_derive::DdsType;

#[derive(DdsType, Clone, PartialEq)]
pub struct Sensor {
    #[dds(key)]
    pub id: i32,
    pub value: f64,
}

Tests

  • crates/cdr-derive/tests/derive_smoke.rs — 6 Tests, byte-genau zu V-2- Wire-Vector aus zerodds-xcdr2-bindings-conformance-1.0 §6.

Stability

1.0.0-rc.3. Macro-Output-Token-Layout kann zwischen Minor-Versionen aendern; semantisch bleibt impl DdsType-Spec-Form gleich.