diff options
author | HampusM <hampus@hampusmat.com> | 2023-09-16 16:04:47 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-09-16 16:04:47 +0200 |
commit | 75ca777bbeb618e14b1cf8854ebb37b7a2c884b5 (patch) | |
tree | a03e6346b0a9b6a584edf5e4feca826f12a35d17 /src/private/factory.rs | |
parent | 31f7949ab380bcd0a0b754588e7d50284d2f5ae7 (diff) |
refactor: make castable factory take DI container param
Diffstat (limited to 'src/private/factory.rs')
-rw-r--r-- | src/private/factory.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/private/factory.rs b/src/private/factory.rs index 84b00c6..af6df8a 100644 --- a/src/private/factory.rs +++ b/src/private/factory.rs @@ -1,13 +1,12 @@ -use std::marker::Tuple; +use std::rc::Rc; use crate::private::cast::CastFrom; use crate::ptr::TransientPtr; /// Interface for a factory. -pub trait IFactory<Args, ReturnInterface>: - Fn<Args, Output = TransientPtr<ReturnInterface>> + CastFrom +pub trait IFactory<ReturnInterface, DIContainerT>: + Fn<(Rc<DIContainerT>,), Output = TransientPtr<ReturnInterface>> + CastFrom where - Args: Tuple, ReturnInterface: 'static + ?Sized, { } @@ -17,7 +16,7 @@ where pub trait IThreadsafeFactory<Args, ReturnInterface>: Fn<Args, Output = TransientPtr<ReturnInterface>> + crate::private::cast::CastFromArc where - Args: Tuple, + Args: std::marker::Tuple, ReturnInterface: 'static + ?Sized, { } |