/// Simple test for a single dynamic factory element use despatma_abstract_factory::{abstract_factory, interpolate_traits}; pub trait Factory { fn create(&self, name: String) -> Box; } pub trait AbstractGuiFactory: Factory {} struct GnomeFactory {} impl AbstractGuiFactory for GnomeFactory {} impl Factory for GnomeFactory { fn create(&self, name: String) -> Box { Box::new(GnomeWindow::new(name)) } }