aboutsummaryrefslogtreecommitdiff
path: root/macros/src/factory/build_declare_interfaces.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-10-04 12:51:06 +0200
committerHampusM <hampus@hampusmat.com>2023-10-04 12:52:22 +0200
commit0f2756536e8fc311119da2af5b4dcc33f41bec6e (patch)
tree0964efe0eaf855017c67fae52da8672a47becc65 /macros/src/factory/build_declare_interfaces.rs
parentc936439bfac9e35958f685a52abb51d781e70a7c (diff)
refactor!: remove factory & declare_default_factory macros
BREAKING CHANGE: The factory and the declare_default_factory macros have been removed. They are no longer needed to use factories
Diffstat (limited to 'macros/src/factory/build_declare_interfaces.rs')
-rw-r--r--macros/src/factory/build_declare_interfaces.rs52
1 files changed, 0 insertions, 52 deletions
diff --git a/macros/src/factory/build_declare_interfaces.rs b/macros/src/factory/build_declare_interfaces.rs
deleted file mode 100644
index 1e2d62e..0000000
--- a/macros/src/factory/build_declare_interfaces.rs
+++ /dev/null
@@ -1,52 +0,0 @@
-use proc_macro2::TokenStream;
-use quote::quote;
-
-use crate::fn_trait::FnTrait;
-
-pub fn build_declare_factory_interfaces(
- factory_interface: &FnTrait,
- is_threadsafe: bool,
-) -> TokenStream
-{
- if is_threadsafe {
- quote! {
- syrette::declare_interface!(
- syrette::private::castable_factory::threadsafe::ThreadsafeCastableFactory<
- #factory_interface,
- syrette::di_container::asynchronous::AsyncDIContainer,
- > -> syrette::private::factory::IThreadsafeFactory<
- #factory_interface,
- syrette::di_container::asynchronous::AsyncDIContainer,
- >,
- threadsafe_sharable = true
- );
-
- syrette::declare_interface!(
- syrette::private::castable_factory::threadsafe::ThreadsafeCastableFactory<
- #factory_interface,
- syrette::di_container::asynchronous::AsyncDIContainer,
- > -> syrette::private::any_factory::AnyThreadsafeFactory,
- threadsafe_sharable = true
- );
- }
- } else {
- quote! {
- syrette::declare_interface!(
- syrette::private::castable_factory::CastableFactory<
- #factory_interface,
- syrette::di_container::blocking::DIContainer
- > -> syrette::private::factory::IFactory<
- #factory_interface,
- syrette::di_container::blocking::DIContainer
- >
- );
-
- syrette::declare_interface!(
- syrette::private::castable_factory::CastableFactory<
- #factory_interface,
- syrette::di_container::blocking::DIContainer
- > -> syrette::private::any_factory::AnyFactory
- );
- }
- }
-}