pub(crate) trait Factory {
type Product;
fn build(self) -> Self::Product;
}
pub(crate) trait ReusableFactory {
type Product;
fn build(&mut self) -> Self::Product;
}
impl<Rf> Factory for Rf
where
Rf: ReusableFactory,
{
type Product = Rf::Product;
fn build(mut self) -> Self::Product {
<Rf as ReusableFactory>::build(&mut self)
}
}