aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/any_factory.rs10
-rw-r--r--src/interfaces/injectable.rs14
2 files changed, 22 insertions, 2 deletions
diff --git a/src/interfaces/any_factory.rs b/src/interfaces/any_factory.rs
index 98ec144..887bb61 100644
--- a/src/interfaces/any_factory.rs
+++ b/src/interfaces/any_factory.rs
@@ -1,6 +1,16 @@
//! Interface for any factory to ever exist.
+use std::fmt::Debug;
+
use crate::libs::intertrait::CastFrom;
/// Interface for any factory to ever exist.
pub trait AnyFactory: CastFrom {}
+
+impl Debug for dyn AnyFactory
+{
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
+ {
+ f.write_str("{}")
+ }
+}
diff --git a/src/interfaces/injectable.rs b/src/interfaces/injectable.rs
index e6e4ced..f90b79d 100644
--- a/src/interfaces/injectable.rs
+++ b/src/interfaces/injectable.rs
@@ -1,5 +1,7 @@
//! Interface for structs that can be injected into or be injected to.
-use crate::errors::injectable::ResolveError;
+use std::fmt::Debug;
+
+use crate::errors::injectable::InjectableError;
use crate::libs::intertrait::CastFrom;
use crate::ptr::TransientPtr;
use crate::DIContainer;
@@ -14,7 +16,15 @@ pub trait Injectable: CastFrom
fn resolve(
di_container: &DIContainer,
dependency_history: Vec<&'static str>,
- ) -> error_stack::Result<TransientPtr<Self>, ResolveError>
+ ) -> Result<TransientPtr<Self>, InjectableError>
where
Self: Sized;
}
+
+impl Debug for dyn Injectable
+{
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
+ {
+ f.write_str("{}")
+ }
+}