diff options
Diffstat (limited to 'src/interfaces/async_injectable.rs')
-rw-r--r-- | src/interfaces/async_injectable.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/interfaces/async_injectable.rs b/src/interfaces/async_injectable.rs index d8e7dfc..2364ae1 100644 --- a/src/interfaces/async_injectable.rs +++ b/src/interfaces/async_injectable.rs @@ -2,18 +2,19 @@ use std::fmt::Debug; use std::sync::Arc; -use crate::dependency_history::IDependencyHistory; use crate::di_container::asynchronous::IAsyncDIContainer; use crate::errors::injectable::InjectableError; use crate::future::BoxFuture; use crate::private::cast::CastFromArc; use crate::ptr::TransientPtr; +use crate::util::use_dependency_history; + +use_dependency_history!(); /// Interface for structs that can be injected into or be injected to. -pub trait AsyncInjectable<DIContainerType, DependencyHistoryType>: CastFromArc +pub trait AsyncInjectable<DIContainerType>: CastFromArc where - DIContainerType: IAsyncDIContainer<DependencyHistoryType>, - DependencyHistoryType: IDependencyHistory + Send + Sync, + DIContainerType: IAsyncDIContainer, { /// Resolves the dependencies of the injectable. /// @@ -21,18 +22,16 @@ where /// Will return `Err` if resolving the dependencies fails. fn resolve<'di_container, 'fut>( di_container: &'di_container Arc<DIContainerType>, - dependency_history: DependencyHistoryType, + dependency_history: DependencyHistory, ) -> BoxFuture<'fut, Result<TransientPtr<Self>, InjectableError>> where Self: Sized + 'fut, 'di_container: 'fut; } -impl<DIContainerType, DependencyHistoryType> Debug - for dyn AsyncInjectable<DIContainerType, DependencyHistoryType> +impl<DIContainerType> Debug for dyn AsyncInjectable<DIContainerType> where - DIContainerType: IAsyncDIContainer<DependencyHistoryType>, - DependencyHistoryType: IDependencyHistory + Send + Sync, + DIContainerType: IAsyncDIContainer, { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |