blob: f491aa09ddc4c4984c5c0aec466ab3837aadfd72 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
mod bootstrap;
mod interfaces;
mod printer;
use std::error::Error;
use bootstrap::bootstrap;
use interfaces::printer::IPrinter;
fn main() -> Result<(), Box<dyn Error>>
{
let di_container = bootstrap();
let string_printer = di_container.get::<dyn IPrinter<String>>()?.transient()?;
string_printer.print("Hello there".to_string());
let int_printer = di_container.get::<dyn IPrinter<i32>>()?.transient()?;
int_printer.print(2782028);
Ok(())
}
|