Skip to main content

PayloadSchemas

Trait PayloadSchemas 

Source
pub trait PayloadSchemas {
    // Provided method
    fn get_payload_schemas() -> Vec<(&'static str, String)> { ... }
}
Expand description

Trait for providing JSON schemas for CopperList payload types.

This trait is implemented by the generated CuMsgs type via the gen_cumsgs! macro when MCAP export support is enabled. It provides compile-time schema information for each task’s payload type, enabling proper schema generation for Foxglove.

The default implementation returns an empty vector for backwards compatibility with code that doesn’t need MCAP export support.

Provided Methods§

Source

fn get_payload_schemas() -> Vec<(&'static str, String)>

Returns a vector of (task_id, schema_json) pairs.

Each entry corresponds to a task in the CopperList, in order. The schema is a JSON Schema string generated from the payload type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§