dust_dds_derive 0.1.0

Derive macro for `DdsType` from `dust-dds`
Documentation

Derive macro for DdsType

This package provides derive macros for DdsType and DdsSerde to support dust-dds.

DdsType can only be derived for structs, tuples and enums. For structs and tuples, the attribute #[key] can be specified either on the whole type or on a subset of fields. For enums, the #[key] attribute can only be specified on the whole type.

Example

A typical user DDS type will look like this:

use dust_dds::topic_definition::type_support::{DdsSerde, DdsType}
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, DdsType, DdsSerde)]
struct HelloWorldType {
    #[key]
    id: u8,
    msg: String,
}