From 9bed6b4d2772fd020ea9eb6eaaba4ca014d96f94 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 14 Sep 2023 19:41:56 +0200 Subject: refactor!: remove blocking DI container interface BREAKING CHANGE: IDIContainer have been removed and multiple structs no longer take a DI container generic parameter --- src/interfaces/injectable.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/interfaces') 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: CastFrom -where - DIContainerType: IDIContainer, +pub trait Injectable: CastFrom { /// Resolves the dependencies of the injectable. /// /// # Errors /// Will return `Err` if resolving the dependencies fails. fn resolve( - di_container: &Rc, + di_container: &Rc, dependency_history: DependencyHistory, ) -> Result, InjectableError> where Self: Sized; } -impl Debug for dyn Injectable -where - DIContainerType: IDIContainer, +impl Debug for dyn Injectable { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { -- cgit v1.2.3-18-g5258