use engine::Engine; use hypospray::{Co, Construct, }; #[inject(Engine)] pub trait Deps { } pub struct SportsCar { pub engine: Co } impl SportsCar { pub fn gas(&self) { println!("{}", self.engine.rev()); } } impl<'dep, M> Construct<'dep> for SportsCar where M: ?Sized + Deps { type Dep = Co; fn __construct(engine: Self::Dep) -> SportsCar { SportsCar { engine: engine, } } }