1 2 3 4 5 6 7 8 9
use syrette::factory; pub trait IFood: Send + Sync { fn eat(&self); } #[factory(threadsafe = true)] pub type IFoodFactory = dyn Fn() -> dyn IFood;