aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/injectable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/injectable.rs')
-rw-r--r--src/interfaces/injectable.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/interfaces/injectable.rs b/src/interfaces/injectable.rs
index d82f042..1d3a1a7 100644
--- a/src/interfaces/injectable.rs
+++ b/src/interfaces/injectable.rs
@@ -30,3 +30,16 @@ impl<DIContainerT> Debug for dyn Injectable<DIContainerT>
f.write_str("{}")
}
}
+
+impl<T, DIContainerT> Injectable<DIContainerT> for T
+where
+ T: Default + 'static,
+{
+ fn resolve(
+ _: &DIContainerT,
+ _: DependencyHistory,
+ ) -> Result<TransientPtr<Self>, InjectableError>
+ {
+ Ok(TransientPtr::new(Self::default()))
+ }
+}