Skip to main content

Crate zerodds_cdr_derive

Crate zerodds_cdr_derive 

Source
Expand description

Crate zerodds-cdr-derive. Safety classification: STANDARD.

#[derive(DdsType)] proc-macro — implements zerodds-xcdr2-rust-1.0 §11.1.

Derives an impl DdsType from a plain struct that serializes via the zerodds_cdr::CdrEncode/CdrDecode traits. Currently supports final extensibility (no DHEADER) — appendable and mutable are reserved for the idl-rust codegen because their per-field logic is not trivially derive-only.

Example:

use zerodds_cdr_derive::DdsType;

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

Derive Macros§

DdsType
Derives DdsType for a plain struct.