diff options
author | HampusM <hampus@hampusmat.com> | 2022-08-21 14:19:07 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-21 18:17:51 +0200 |
commit | 8c66b98bca6ed0a2990903fe8e0ea72def5c7be8 (patch) | |
tree | deed78171051262dba7e8d97eba73a9aaf04dd5e /src/interfaces/injectable.rs | |
parent | b3e1b993b028bbfa73638236cfbdb50ee478d3f0 (diff) |
refactor!: change errors to be more sane
BREAKING CHANGE: Major improvements have been made to error types and the error_stack crate is no longer used
Diffstat (limited to 'src/interfaces/injectable.rs')
-rw-r--r-- | src/interfaces/injectable.rs | 14 |
1 files changed, 12 insertions, 2 deletions
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("{}") + } +} |