aboutsummaryrefslogtreecommitdiff
path: root/examples/factory/bootstrap.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-08-20 15:14:13 +0200
committerHampusM <hampus@hampusmat.com>2022-08-21 18:17:50 +0200
commit47c68f7d70cfa8c639f72361d8d0362048647075 (patch)
tree871f3577e54f77aa51368f1e34012c1f4f31e44d /examples/factory/bootstrap.rs
parentc4eccc81d9bfa472197a4f302df1c967081a0be5 (diff)
docs: improve the factory example
Diffstat (limited to 'examples/factory/bootstrap.rs')
-rw-r--r--examples/factory/bootstrap.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/factory/bootstrap.rs b/examples/factory/bootstrap.rs
index a44ccfb..b752764 100644
--- a/examples/factory/bootstrap.rs
+++ b/examples/factory/bootstrap.rs
@@ -3,15 +3,22 @@ use syrette::DIContainer;
// Interfaces
use crate::interfaces::user::{IUser, IUserFactory};
+use crate::interfaces::user_manager::IUserManager;
//
// Concrete implementations
use crate::user::User;
+use crate::user_manager::UserManager;
pub fn bootstrap() -> DIContainer
{
let mut di_container: DIContainer = DIContainer::new();
di_container
+ .bind::<dyn IUserManager>()
+ .to::<UserManager>()
+ .unwrap();
+
+ di_container
.bind::<IUserFactory>()
.to_factory(&|name, date_of_birth, password| {
let user: TransientPtr<dyn IUser> =