aboutsummaryrefslogtreecommitdiff
path: root/src/private/factory.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-09-18 20:35:55 +0200
committerHampusM <hampus@hampusmat.com>2023-09-18 20:35:55 +0200
commit6d729a4d20944b990c341149729a810a2898cdff (patch)
treef64218f129b5f7c168e64ede3b99fddb7faca8ac /src/private/factory.rs
parente4fdf58b42c61482741cb12e1faa24cbd50698e8 (diff)
refactor: make threadsafe castable factory take DI container param
Diffstat (limited to 'src/private/factory.rs')
-rw-r--r--src/private/factory.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/private/factory.rs b/src/private/factory.rs
index 94e1023..730338f 100644
--- a/src/private/factory.rs
+++ b/src/private/factory.rs
@@ -1,3 +1,6 @@
+#[cfg(feature = "async")]
+use std::sync::Arc;
+
use crate::private::cast::CastFrom;
use crate::ptr::TransientPtr;
@@ -11,10 +14,10 @@ where
/// Interface for a threadsafe factory.
#[cfg(feature = "async")]
-pub trait IThreadsafeFactory<Args, ReturnInterface>:
- Fn<Args, Output = TransientPtr<ReturnInterface>> + crate::private::cast::CastFromArc
+pub trait IThreadsafeFactory<ReturnInterface, DIContainerT>:
+ Fn<(Arc<DIContainerT>,), Output = TransientPtr<ReturnInterface>>
+ + crate::private::cast::CastFromArc
where
- Args: std::marker::Tuple,
ReturnInterface: 'static + ?Sized,
{
}