diff options
Diffstat (limited to 'src/interfaces/injectable.rs')
-rw-r--r-- | src/interfaces/injectable.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/interfaces/injectable.rs b/src/interfaces/injectable.rs new file mode 100644 index 0000000..24032a6 --- /dev/null +++ b/src/interfaces/injectable.rs @@ -0,0 +1,17 @@ +use crate::errors::injectable::ResolveError; +use crate::libs::intertrait::CastFrom; +use crate::ptr::InterfacePtr; +use crate::DIContainer; + +pub trait Injectable: CastFrom +{ + /// Resolves the dependencies of the injectable. + /// + /// # Errors + /// Will return `Err` if resolving the dependencies fails. + fn resolve( + di_container: &DIContainer, + ) -> error_stack::Result<InterfacePtr<Self>, ResolveError> + where + Self: Sized; +} |