//! Module interfaces can be used with `Inject` and `InjectProvided`. //! The module itself would be stored in state as `Box`. #![allow(clippy::let_unit_value)] use shaku::{module, Component, HasComponent, HasProvider, Interface, Provider}; use shaku_rocket::{Inject, InjectProvided}; trait MyComponent: Interface {} trait MyProvider {} #[derive(Component)] #[shaku(interface = MyComponent)] struct MyComponentImpl; impl MyComponent for MyComponentImpl {} #[derive(Provider)] #[shaku(interface = MyProvider)] struct MyProviderImpl; impl MyProvider for MyProviderImpl {} trait MyModule: HasComponent + HasProvider {} module! { MyModuleImpl: MyModule { components = [MyComponentImpl], providers = [MyProviderImpl] } } #[allow(unused)] #[rocket::get("/")] fn index( _component: Inject, _provider: InjectProvided, ) { } #[test] fn compiles_ok() {}