aboutsummaryrefslogtreecommitdiff
path: root/examples/factory/interfaces/user.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-09-12 20:22:13 +0200
committerHampusM <hampus@hampusmat.com>2022-09-17 14:33:15 +0200
commitc1e682c25c24be3174d44ceb95b0537c38299d0c (patch)
tree6e59f37e1b98e68fad2e3e2fe4a428ac97fcf8b4 /examples/factory/interfaces/user.rs
parente8e48906a3899e71c9c9d86a3d4528cb7d17e5b9 (diff)
feat!: allow factories access to DI container
BREAKING CHANGE: Factory types should now be written with the Fn trait instead of the IFactory trait and the to_factory & to_default_factory methods of BindingBuilder now expect a function returning a factory function
Diffstat (limited to 'examples/factory/interfaces/user.rs')
-rw-r--r--examples/factory/interfaces/user.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/factory/interfaces/user.rs b/examples/factory/interfaces/user.rs
index 70cd632..aafd0cb 100644
--- a/examples/factory/interfaces/user.rs
+++ b/examples/factory/interfaces/user.rs
@@ -1,5 +1,5 @@
use syrette::factory;
-use syrette::interfaces::factory::IFactory;
+use syrette::ptr::TransientPtr;
pub trait IUser
{
@@ -10,4 +10,4 @@ pub trait IUser
#[factory]
pub type IUserFactory =
- dyn IFactory<(&'static str, &'static str, &'static str), dyn IUser>;
+ dyn Fn(&'static str, &'static str, &'static str) -> TransientPtr<dyn IUser>;