aboutsummaryrefslogtreecommitdiff
path: root/examples/generics/main.rs
blob: 9442641e6414080c8a6aeaf38169e726fd7f9ca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
mod bootstrap;
mod interfaces;
mod printer;

use bootstrap::bootstrap;
use interfaces::printer::IPrinter;

fn main()
{
    let di_container = bootstrap();

    let string_printer = di_container.get::<dyn IPrinter<String>>().unwrap();

    string_printer.print("Hello there".to_string());

    let int_printer = di_container.get::<dyn IPrinter<i32>>().unwrap();

    int_printer.print(2782028);
}