aboutsummaryrefslogtreecommitdiff
path: root/macros/src/injectable
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-10-23 18:12:23 +0200
committerHampusM <hampus@hampusmat.com>2022-10-23 18:12:23 +0200
commit9e01cdf341a7866180b3a63d745f3b2d7578d28a (patch)
tree0c036b7b4a68e44b6eb2221bf7beb3c34fe9c1c8 /macros/src/injectable
parent740ef47d49e02ae2f2184f4c347d8eba8aee38fd (diff)
refactor!: reduce DI container coupling
BREAKING CHANGE: You now have to import the DI containers's interfaces to use the DI containers's methods
Diffstat (limited to 'macros/src/injectable')
-rw-r--r--macros/src/injectable/implementation.rs16
1 files changed, 12 insertions, 4 deletions
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<Dep: IDependency> InjectableImpl<Dep>
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<Dep: IDependency> InjectableImpl<Dep>
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<Dep: IDependency> InjectableImpl<Dep>
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<syrette::DIContainer>,
+ #di_container_var: &std::rc::Rc<
+ syrette::di_container::blocking::DIContainer
+ >,
mut #dependency_history_var: Vec<&'static str>,
) -> Result<
syrette::ptr::TransientPtr<Self>,
@@ -194,6 +201,7 @@ impl<Dep: IDependency> InjectableImpl<Dep>
{
use std::any::type_name;
+ use syrette::di_container::blocking::IDIContainer;
use syrette::errors::injectable::InjectableError;
let self_type_name = type_name::<#self_type>();