diff options
author | HampusM <hampus@hampusmat.com> | 2022-09-17 12:57:18 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-09-17 12:57:18 +0200 |
commit | e8e48906a3899e71c9c9d86a3d4528cb7d17e5b9 (patch) | |
tree | 6c0eea09dff3be733693f0db0f521bd2d1f2a3e5 /src/provider | |
parent | ea0309436b55d72f57478ed6f74bf31d000f5366 (diff) |
refactor!: make DI container be used inside of a Rc
BREAKING CHANGE: The DI container is to be used inside of a Rc & it also no longer implements Default
Diffstat (limited to 'src/provider')
-rw-r--r-- | src/provider/blocking.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/provider/blocking.rs b/src/provider/blocking.rs index 13674b9..69bbe78 100644 --- a/src/provider/blocking.rs +++ b/src/provider/blocking.rs @@ -1,5 +1,6 @@ #![allow(clippy::module_name_repetitions)] use std::marker::PhantomData; +use std::rc::Rc; use crate::errors::injectable::InjectableError; use crate::interfaces::injectable::Injectable; @@ -19,7 +20,7 @@ pub trait IProvider { fn provide( &self, - di_container: &DIContainer, + di_container: &Rc<DIContainer>, dependency_history: Vec<&'static str>, ) -> Result<Providable, InjectableError>; } @@ -49,7 +50,7 @@ where { fn provide( &self, - di_container: &DIContainer, + di_container: &Rc<DIContainer>, dependency_history: Vec<&'static str>, ) -> Result<Providable, InjectableError> { @@ -83,7 +84,7 @@ where { fn provide( &self, - _di_container: &DIContainer, + _di_container: &Rc<DIContainer>, _dependency_history: Vec<&'static str>, ) -> Result<Providable, InjectableError> { @@ -113,7 +114,7 @@ impl IProvider for FactoryProvider { fn provide( &self, - _di_container: &DIContainer, + _di_container: &Rc<DIContainer>, _dependency_history: Vec<&'static str>, ) -> Result<Providable, InjectableError> { |