#![allow(dead_code)] #[macro_use] extern crate he_di_derive; extern crate he_di; #[derive(Component)] #[interface(Foo)] struct TestComponent1 { #[inject] var: Box, } #[derive(Component)] #[interface(Foo)] struct TestComponent2 { var1: usize, #[inject] var2: Box, } struct OtherStruct { val: usize, } trait Foo { fn foo(&self); } trait Bar { fn bar(&self); } impl Foo for TestComponent1 { fn foo(&self) { () } } impl Foo for TestComponent2 { fn foo(&self) { () } } #[test] fn compile_ok() { }