aboutsummaryrefslogtreecommitdiff
path: root/src/provider.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/provider.rs')
-rw-r--r--src/provider.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/provider.rs b/src/provider.rs
index 2e832f8..e12a12a 100644
--- a/src/provider.rs
+++ b/src/provider.rs
@@ -7,8 +7,6 @@ use crate::interfaces::injectable::Injectable;
use crate::ptr::{FactoryPtr, SingletonPtr, TransientPtr};
use crate::DIContainer;
-extern crate error_stack;
-
pub enum Providable
{
Transient(TransientPtr<dyn Injectable>),
@@ -22,6 +20,7 @@ pub trait IProvider
fn provide(
&self,
di_container: &DIContainer,
+ dependency_history: Vec<&'static str>,
) -> error_stack::Result<Providable, ResolveError>;
}
@@ -51,10 +50,12 @@ where
fn provide(
&self,
di_container: &DIContainer,
+ dependency_history: Vec<&'static str>,
) -> error_stack::Result<Providable, ResolveError>
{
Ok(Providable::Transient(InjectableType::resolve(
di_container,
+ dependency_history,
)?))
}
}
@@ -83,6 +84,7 @@ where
fn provide(
&self,
_di_container: &DIContainer,
+ _dependency_history: Vec<&'static str>,
) -> error_stack::Result<Providable, ResolveError>
{
Ok(Providable::Singleton(self.singleton.clone()))
@@ -110,6 +112,7 @@ impl IProvider for FactoryProvider
fn provide(
&self,
_di_container: &DIContainer,
+ _dependency_history: Vec<&'static str>,
) -> error_stack::Result<Providable, ResolveError>
{
Ok(Providable::Factory(self.factory.clone()))