diff options
Diffstat (limited to 'src/di_container/asynchronous/binding/when_configurator.rs')
-rw-r--r-- | src/di_container/asynchronous/binding/when_configurator.rs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/di_container/asynchronous/binding/when_configurator.rs b/src/di_container/asynchronous/binding/when_configurator.rs index 39e1807..d08239e 100644 --- a/src/di_container/asynchronous/binding/when_configurator.rs +++ b/src/di_container/asynchronous/binding/when_configurator.rs @@ -5,38 +5,32 @@ use std::any::type_name; use std::marker::PhantomData; use std::sync::Arc; -use crate::dependency_history::IDependencyHistory; use crate::di_container::asynchronous::IAsyncDIContainer; use crate::errors::async_di_container::AsyncBindingWhenConfiguratorError; /// When configurator for a binding for type `Interface` inside a [`IAsyncDIContainer`]. /// /// [`IAsyncDIContainer`]: crate::di_container::asynchronous::IAsyncDIContainer -pub struct AsyncBindingWhenConfigurator<Interface, DIContainerType, DependencyHistoryType> +pub struct AsyncBindingWhenConfigurator<Interface, DIContainerType> where Interface: 'static + ?Sized + Send + Sync, - DIContainerType: IAsyncDIContainer<DependencyHistoryType>, - DependencyHistoryType: IDependencyHistory + Send + Sync, + DIContainerType: IAsyncDIContainer, { di_container: Arc<DIContainerType>, interface_phantom: PhantomData<Interface>, - dependency_history_phantom: PhantomData<DependencyHistoryType>, } -impl<Interface, DIContainerType, DependencyHistoryType> - AsyncBindingWhenConfigurator<Interface, DIContainerType, DependencyHistoryType> +impl<Interface, DIContainerType> AsyncBindingWhenConfigurator<Interface, DIContainerType> where Interface: 'static + ?Sized + Send + Sync, - DIContainerType: IAsyncDIContainer<DependencyHistoryType>, - DependencyHistoryType: IDependencyHistory + Send + Sync, + DIContainerType: IAsyncDIContainer, { pub(crate) fn new(di_container: Arc<DIContainerType>) -> Self { Self { di_container, interface_phantom: PhantomData, - dependency_history_phantom: PhantomData, } } @@ -99,8 +93,7 @@ mod tests let binding_when_configurator = AsyncBindingWhenConfigurator::< dyn subjects_async::INumber, - mocks::async_di_container::MockAsyncDIContainer<mocks::MockDependencyHistory>, - mocks::MockDependencyHistory, + mocks::async_di_container::MockAsyncDIContainer, >::new(Arc::new(di_container_mock)); assert!(binding_when_configurator |