aboutsummaryrefslogtreecommitdiff
path: root/examples/factory/main.rs
blob: 0f1a97b288a39ea2af4e766f7ec0af91405a3fb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#![deny(clippy::all)]
#![deny(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]

mod bootstrap;
mod interfaces;
mod user;
mod user_manager;

use std::error::Error;

use bootstrap::bootstrap;

use crate::interfaces::user_manager::IUserManager;

fn main() -> Result<(), Box<dyn Error>>
{
    println!("Hello, world!");

    let di_container = bootstrap()?;

    let mut user_manager = di_container.get::<dyn IUserManager>()?.transient()?;

    user_manager.fill_with_users();

    println!("Printing user information");

    user_manager.print_users();

    Ok(())
}