DomainStruct

Trait DomainStruct 

Source
pub trait DomainStruct: Send + Sync {
    // Required method
    fn domain_class() -> DomainClass;
}
Expand description

Trait for structs that can be represented in the domain model.

This trait is used 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.

§Derive Macro

This trait is typically implemented via #[derive(DomainStruct)]:

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

When a PlanningSolution references types that implement DomainStruct, those classes are automatically included in the domain model.

Required Methods§

Source

fn domain_class() -> DomainClass

Returns the domain class descriptor for this struct.

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§