aboutsummaryrefslogtreecommitdiff
path: root/macros/src/injectable
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-01-30 22:25:02 +0100
committerHampusM <hampus@hampusmat.com>2023-01-30 22:25:02 +0100
commite8a2475b2f07da14c45a429b2b52e75322d0efb5 (patch)
treeac359083d6cacf51d7bb6ef6d6e1686ad04504c4 /macros/src/injectable
parent178267c701c233542078c09fe6b19802f9642dbd (diff)
fix: add missing dummy async injectable impl
Diffstat (limited to 'macros/src/injectable')
-rw-r--r--macros/src/injectable/implementation.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/macros/src/injectable/implementation.rs b/macros/src/injectable/implementation.rs
index 0fd73de..e81dd2d 100644
--- a/macros/src/injectable/implementation.rs
+++ b/macros/src/injectable/implementation.rs
@@ -328,6 +328,43 @@ impl<Dep: IDependency> InjectableImpl<Dep>
}
}
+ #[cfg(not(tarpaulin_include))]
+ pub fn expand_dummy_async_impl(&self) -> proc_macro2::TokenStream
+ {
+ let generics = &self.generics;
+ let self_type = &self.self_type;
+
+ let di_container_var = format_ident!("{}", DI_CONTAINER_VAR_NAME);
+ let dependency_history_var = format_ident!("{}", DEPENDENCY_HISTORY_VAR_NAME);
+
+ quote! {
+ impl #generics syrette::interfaces::async_injectable::AsyncInjectable<
+ syrette::di_container::asynchronous::AsyncDIContainer,
+ syrette::dependency_history::DependencyHistory
+ > for #self_type
+ {
+ fn resolve<'di_container, 'fut>(
+ #di_container_var: &'di_container std::sync::Arc<
+ syrette::di_container::asynchronous::AsyncDIContainer
+ >,
+ mut #dependency_history_var: syrette::dependency_history::DependencyHistory
+ ) -> syrette::future::BoxFuture<
+ 'fut,
+ Result<
+ syrette::ptr::TransientPtr<Self>,
+ syrette::errors::injectable::InjectableError
+ >
+ >
+ where
+ Self: Sized + 'fut,
+ 'di_container: 'fut
+ {
+ unimplemented!();
+ }
+ }
+ }
+ }
+
fn create_get_dep_method_calls(
dependencies: &[Dep],
is_async: bool,