aboutsummaryrefslogtreecommitdiff
path: root/src/di_container/blocking/binding
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-09-15 23:02:34 +0200
committerHampusM <hampus@hampusmat.com>2024-09-15 23:22:33 +0200
commita34f7c03779aaf90f34b5ff59587daf1db42de8d (patch)
treed5a2f057b70932e44999fd0f2389811fad5a4478 /src/di_container/blocking/binding
parentb655d0e439da0da468e02d394e1189c5603fe752 (diff)
refactor: rename factory provider to function provider
Diffstat (limited to 'src/di_container/blocking/binding')
-rw-r--r--src/di_container/blocking/binding/builder.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/di_container/blocking/binding/builder.rs b/src/di_container/blocking/binding/builder.rs
index ead1a54..345fb02 100644
--- a/src/di_container/blocking/binding/builder.rs
+++ b/src/di_container/blocking/binding/builder.rs
@@ -181,7 +181,10 @@ where
Interface: Fn<Args, Output = crate::ptr::TransientPtr<Return>>,
Func: Fn(&DIContainer) -> Box<Interface>,
{
+ use std::rc::Rc;
+
use crate::castable_function::CastableFunction;
+ use crate::provider::blocking::ProvidableFunctionKind;
if self
.di_container
@@ -196,9 +199,9 @@ where
self.di_container.set_binding::<Interface>(
BindingOptions::new(),
- Box::new(crate::provider::blocking::FactoryProvider::new(
- crate::ptr::FactoryPtr::new(factory_impl),
- false,
+ Box::new(crate::provider::blocking::FunctionProvider::new(
+ Rc::new(factory_impl),
+ ProvidableFunctionKind::UserCalled,
)),
);
@@ -269,7 +272,10 @@ where
dyn Fn<(), Output = crate::ptr::TransientPtr<Return>>,
>,
{
+ use std::rc::Rc;
+
use crate::castable_function::CastableFunction;
+ use crate::provider::blocking::ProvidableFunctionKind;
if self
.di_container
@@ -284,9 +290,9 @@ where
self.di_container.set_binding::<Interface>(
BindingOptions::new(),
- Box::new(crate::provider::blocking::FactoryProvider::new(
- crate::ptr::FactoryPtr::new(factory_impl),
- true,
+ Box::new(crate::provider::blocking::FunctionProvider::new(
+ Rc::new(factory_impl),
+ ProvidableFunctionKind::Instant,
)),
);