aboutsummaryrefslogtreecommitdiff
path: root/example/src/main.rs
blob: 956b79e621f446b04c0bb9d49b42d4da4327f1c8 (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
#![deny(clippy::all)]
#![deny(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]

use syrette::errors::di_container::DIContainerError;

mod animals;
mod bootstrap;
mod interfaces;

use bootstrap::bootstrap;
use interfaces::dog::IDog;
use interfaces::human::IHuman;

fn main() -> error_stack::Result<(), DIContainerError>
{
    println!("Hello, world!");

    let di_container = bootstrap();

    let dog = di_container.get::<dyn IDog>()?;

    dog.woof();

    let human = di_container.get::<dyn IHuman>()?;

    human.make_pets_make_sounds();

    Ok(())
}