diff options
author | HampusM <hampus@hampusmat.com> | 2023-09-18 22:35:58 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-09-18 22:35:58 +0200 |
commit | 4fd0d6b4951b08a20d5378bca75561109dc6d036 (patch) | |
tree | 8496d679e7ee3debcd415ed563911e2166594212 /src/interfaces/async_injectable.rs | |
parent | de2e1349f459f7f69226b2decd366be690426ea7 (diff) |
refactor!: make the async DI container not inside a Arc
BREAKING CHANGE: The async DI container is no longer inside of a Arc. This affects AsyncBindingBuilder, AsyncBindingScopeConfigurator, AsyncBindingWhenConfigurator & AsyncInjectable
Diffstat (limited to 'src/interfaces/async_injectable.rs')
-rw-r--r-- | src/interfaces/async_injectable.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/interfaces/async_injectable.rs b/src/interfaces/async_injectable.rs index c455970..4c18487 100644 --- a/src/interfaces/async_injectable.rs +++ b/src/interfaces/async_injectable.rs @@ -1,6 +1,5 @@ //! Interface for structs that can be injected into or be injected to. use std::fmt::Debug; -use std::sync::Arc; use crate::errors::injectable::InjectableError; use crate::future::BoxFuture; @@ -11,14 +10,14 @@ use crate::util::use_double; use_double!(crate::dependency_history::DependencyHistory); /// Interface for structs that can be injected into or be injected to. -pub trait AsyncInjectable<DIContainerType>: CastFromArc +pub trait AsyncInjectable<DIContainerT>: CastFromArc { /// Resolves the dependencies of the injectable. /// /// # Errors /// Will return `Err` if resolving the dependencies fails. fn resolve<'di_container, 'fut>( - di_container: &'di_container Arc<DIContainerType>, + di_container: &'di_container DIContainerT, dependency_history: DependencyHistory, ) -> BoxFuture<'fut, Result<TransientPtr<Self>, InjectableError>> where @@ -26,7 +25,7 @@ pub trait AsyncInjectable<DIContainerType>: CastFromArc 'di_container: 'fut; } -impl<DIContainerType> Debug for dyn AsyncInjectable<DIContainerType> +impl<DIContainerT> Debug for dyn AsyncInjectable<DIContainerT> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |