From c1e682c25c24be3174d44ceb95b0537c38299d0c Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 12 Sep 2022 20:22:13 +0200 Subject: 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 --- examples/factory/interfaces/user.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/factory/interfaces') 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; -- cgit v1.2.3-18-g5258