DomainStruct

Derive Macro DomainStruct 

Source
#[derive(DomainStruct)]
Expand description

Derive macro for implementing the DomainStruct trait.

Use this for nested structs (like Location) that are not planning entities but need their fields accessible in WASM memory for constraint evaluation and shadow variable computation.

§Example

#[derive(DomainStruct, Clone)]
struct Location {
    latitude: f64,
    longitude: f64,
}

The struct’s fields will be registered in the domain model, enabling expressions to access them via nested field access:

Expression::FieldAccess {
    object: Box::new(visit_location_expr),
    class_name: "Location".to_string(),
    field_name: "latitude".to_string(),
    field_type: WasmFieldType::F64,
}