/// Complex test with all the bells and whistles - mixed types with extra traits use despatma_abstract_factory::{abstract_factory, interpolate_traits}; pub trait Factory { fn create(&self) -> Box; } pub trait AbstractFactory: Display + Eq + Factory< dyn Circle, > + Factory + Factory + Factory + Factory {} struct RedFactory {} impl AbstractFactory for RedFactory {} impl Factory for RedFactory { fn create(&self) -> Box { Box::new(BlueCircle::new()) } } impl Factory for RedFactory { fn create(&self) -> Box { Box::new(BlueRectangle::new()) } } impl Factory for RedFactory { fn create(&self) -> Box { Box::new(BlueSphere::new()) } } impl Factory for RedFactory { fn create(&self) -> Box { Box::new(BlueCube::new()) } } impl Factory for RedFactory { fn create(&self) -> Box { Box::new(Arc::new()) } }