Closed nicolascotton closed 1 year ago
Proposal:
mod sub { #[injectable] struct InternalType( #[inject(123)] i32); // Not visible outside of module. #[injectable] pub struct Facade<'a> { hidden: &'a InternalType } #[module] pub struct Module { #[export] hidden: InternalType } } #[provider] struct Provider { #[import] subModule: sub::Module } fn main() { #[provider] struct InitProvider; let provider = InitProvider.provide::<Provider>(); let _facade = provider.provide::<sub::Facade>(); }
Proposal: