blob: e54b16895f34295e387b5802cbbec0ce144d8fcc (
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 crate::bootstrap::bootstrap;
use crate::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(())
}
|