/// Test using dyn on a concrete type mod library; use despatma_abstract_factory::{abstract_factory, interpolate_traits}; use library::elements::{Element, Window}; // Factory for a single element pub trait Factory { fn create(&self) -> Box; } // Abstract Factory for multiple elements #[abstract_factory(Factory, dyn Window)] pub trait AbstractGuiFactory {} // Concrete factory implementing the abstract factory struct GnomeFactory {} impl AbstractGuiFactory for GnomeFactory {} // Implement the factory trait for each type #[interpolate_traits(Window => Window)] impl Factory for GnomeFactory { fn create(&self) -> Box { Box::new(CONCRETE::create()) } } fn main() {}