//! Module interfaces can be used with `Inject` and `InjectProvided`. //! The module itself would be stored in state as `Arc`. use shaku::{module, Component, HasComponent, HasProvider, Interface, Provider}; use shaku_axum::{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)] async fn index( _component: Inject, _provider: InjectProvided, ) { } #[test] fn compiles_ok() {}