From 4fd0d6b4951b08a20d5378bca75561109dc6d036 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 18 Sep 2023 22:35:58 +0200 Subject: 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 --- src/interfaces/async_injectable.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/interfaces') 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: CastFromArc +pub trait AsyncInjectable: 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, + di_container: &'di_container DIContainerT, dependency_history: DependencyHistory, ) -> BoxFuture<'fut, Result, InjectableError>> where @@ -26,7 +25,7 @@ pub trait AsyncInjectable: CastFromArc 'di_container: 'fut; } -impl Debug for dyn AsyncInjectable +impl Debug for dyn AsyncInjectable { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { -- cgit v1.2.3-18-g5258