From 9e01cdf341a7866180b3a63d745f3b2d7578d28a Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 23 Oct 2022 18:12:23 +0200 Subject: refactor!: reduce DI container coupling BREAKING CHANGE: You now have to import the DI containers's interfaces to use the DI containers's methods --- macros/src/injectable/implementation.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'macros') diff --git a/macros/src/injectable/implementation.rs b/macros/src/injectable/implementation.rs index 9542a98..6cde446 100644 --- a/macros/src/injectable/implementation.rs +++ b/macros/src/injectable/implementation.rs @@ -132,11 +132,13 @@ impl InjectableImpl quote! { #maybe_doc_hidden - impl #generics syrette::interfaces::async_injectable::AsyncInjectable for #self_type + impl #generics syrette::interfaces::async_injectable::AsyncInjectable< + syrette::di_container::asynchronous::AsyncDIContainer + > for #self_type { fn resolve<'di_container, 'fut>( #di_container_var: &'di_container std::sync::Arc< - syrette::AsyncDIContainer + syrette::di_container::asynchronous::AsyncDIContainer >, mut #dependency_history_var: Vec<&'static str>, ) -> syrette::future::BoxFuture< @@ -153,6 +155,7 @@ impl InjectableImpl Box::pin(async move { use std::any::type_name; + use syrette::di_container::asynchronous::IAsyncDIContainer; use syrette::errors::injectable::InjectableError; let self_type_name = type_name::<#self_type>(); @@ -183,10 +186,14 @@ impl InjectableImpl quote! { #maybe_doc_hidden - impl #generics syrette::interfaces::injectable::Injectable for #self_type + impl #generics syrette::interfaces::injectable::Injectable< + syrette::di_container::blocking::DIContainer + > for #self_type { fn resolve( - #di_container_var: &std::rc::Rc, + #di_container_var: &std::rc::Rc< + syrette::di_container::blocking::DIContainer + >, mut #dependency_history_var: Vec<&'static str>, ) -> Result< syrette::ptr::TransientPtr, @@ -194,6 +201,7 @@ impl InjectableImpl { use std::any::type_name; + use syrette::di_container::blocking::IDIContainer; use syrette::errors::injectable::InjectableError; let self_type_name = type_name::<#self_type>(); -- cgit v1.2.3-18-g5258