/// Simple test for multiple dynamic factory elements use despatma_abstract_factory::{abstract_factory, interpolate_traits}; pub trait Factory { fn create(&self) -> Box; } pub trait AbstractFactory: Factory< dyn Circle, > + Factory< dyn Rectangle, > + Factory + Factory + Factory {} struct BlueFactory {} impl AbstractFactory for BlueFactory {} impl Factory for BlueFactory { fn create(&self) -> Box { Box::new(BlueCircle::new()) } } impl Factory for BlueFactory { fn create(&self) -> Box { Box::new(BlueRectangle::new()) } } impl Factory for BlueFactory { fn create(&self) -> Box { Box::new(BlueArc::new()) } } impl Factory for BlueFactory { fn create(&self) -> Box { Box::new(BlueSphere::new()) } } impl Factory for BlueFactory { fn create(&self) -> Box { Box::new(BlueCube::new()) } }