Skip to main content

payload

Attribute Macro payload 

Source
#[payload]
Expand description

Attach to a plain data struct to auto-derive Serialize, Deserialize, and JsonSchema. Use for command request / response types (and any other struct you want those traits on) so user crates only need to depend on coralstack-cmd-ipc.

use coralstack_cmd_ipc::prelude::*;

#[payload]
struct AddReq { a: i64, b: i64 }

#[payload]
struct AddRes { sum: i64 }

Users who need extra derives (Clone, Debug, PartialEq, custom #[serde(...)] attributes) add them normally — #[payload] is additive.