/// Simple test for multiple dynamic factory elements use despatma_abstract_factory::{abstract_factory, interpolate_traits}; // Factory for a single shape pub trait Factory { fn create(&self) -> Box; } // Abstract Factory for multiple shapes #[abstract_factory(Factory, dyn Circle, dyn Rectangle, dyn Arc, dyn Sphere, dyn Cube)] pub trait AbstractFactory {} // Concrete factory implementing the abstract factory struct BlueFactory {} impl AbstractFactory for BlueFactory {} // Implement the factory trait for each type #[interpolate_traits( Circle => BlueCircle, Rectangle => BlueRectangle, Arc => BlueArc, Sphere => BlueSphere, Cube => BlueCube, )] impl Factory for BlueFactory { fn create(&self) -> Box { Box::new(CONCRETE::new()) } }