aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-09-24 17:31:16 +0200
committerHampusM <hampus@hampusmat.com>2022-09-24 17:33:10 +0200
commitfdd7f824fd1244226ca86f525f8439744676688f (patch)
tree073019e506e36578caeab894835ccf51dc5d7584 /src/interfaces
parentfebfb927b27ab03041500b16c65bdbc0624a5a72 (diff)
feat: add bind async default factories to async DI container
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/factory.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/interfaces/factory.rs b/src/interfaces/factory.rs
index b09db36..de1fca9 100644
--- a/src/interfaces/factory.rs
+++ b/src/interfaces/factory.rs
@@ -9,3 +9,12 @@ where
ReturnInterface: 'static + ?Sized,
{
}
+
+/// Interface for a threadsafe factory.
+#[cfg(feature = "async")]
+pub trait IThreadsafeFactory<Args, ReturnInterface>:
+ Fn<Args, Output = TransientPtr<ReturnInterface>> + crate::libs::intertrait::CastFromSync
+where
+ ReturnInterface: 'static + ?Sized,
+{
+}