diff options
author | HampusM <hampus@hampusmat.com> | 2023-09-14 19:41:56 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-09-14 21:17:37 +0200 |
commit | 9bed6b4d2772fd020ea9eb6eaaba4ca014d96f94 (patch) | |
tree | dff0d7768f4a56c9d75e4a6c89974891373e997b /src/interfaces | |
parent | 9a7cf8cfd376da09c982606aa79f253319dfe382 (diff) |
refactor!: remove blocking DI container interface
BREAKING CHANGE: IDIContainer have been removed and multiple structs no longer take a DI container generic parameter
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/injectable.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/interfaces/injectable.rs b/src/interfaces/injectable.rs index 2622320..458b167 100644 --- a/src/interfaces/injectable.rs +++ b/src/interfaces/injectable.rs @@ -2,7 +2,6 @@ use std::fmt::Debug; use std::rc::Rc; -use crate::di_container::blocking::IDIContainer; use crate::errors::injectable::InjectableError; use crate::private::cast::CastFrom; use crate::ptr::TransientPtr; @@ -11,25 +10,21 @@ 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 Injectable<DIContainerType>: CastFrom -where - DIContainerType: IDIContainer, +pub trait Injectable<DIContainerT>: CastFrom { /// Resolves the dependencies of the injectable. /// /// # Errors /// Will return `Err` if resolving the dependencies fails. fn resolve( - di_container: &Rc<DIContainerType>, + di_container: &Rc<DIContainerT>, dependency_history: DependencyHistory, ) -> Result<TransientPtr<Self>, InjectableError> where Self: Sized; } -impl<DIContainerType> Debug for dyn Injectable<DIContainerType> -where - DIContainerType: IDIContainer, +impl<DIContainerT> Debug for dyn Injectable<DIContainerT> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |