aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/injectable.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-09-17 12:57:18 +0200
committerHampusM <hampus@hampusmat.com>2022-09-17 12:57:18 +0200
commite8e48906a3899e71c9c9d86a3d4528cb7d17e5b9 (patch)
tree6c0eea09dff3be733693f0db0f521bd2d1f2a3e5 /src/interfaces/injectable.rs
parentea0309436b55d72f57478ed6f74bf31d000f5366 (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/interfaces/injectable.rs')
-rw-r--r--src/interfaces/injectable.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/interfaces/injectable.rs b/src/interfaces/injectable.rs
index f90b79d..f4c7fda 100644
--- a/src/interfaces/injectable.rs
+++ b/src/interfaces/injectable.rs
@@ -1,5 +1,6 @@
//! Interface for structs that can be injected into or be injected to.
use std::fmt::Debug;
+use std::rc::Rc;
use crate::errors::injectable::InjectableError;
use crate::libs::intertrait::CastFrom;
@@ -14,7 +15,7 @@ pub trait Injectable: CastFrom
/// # Errors
/// Will return `Err` if resolving the dependencies fails.
fn resolve(
- di_container: &DIContainer,
+ di_container: &Rc<DIContainer>,
dependency_history: Vec<&'static str>,
) -> Result<TransientPtr<Self>, InjectableError>
where