aboutsummaryrefslogtreecommitdiff
path: root/examples/generics/bootstrap.rs
blob: 752a39b95430e54fcfc36c2a0c33bb768d855ce2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use std::rc::Rc;

use syrette::{di_container_bind, DIContainer};

// Interfaces
use crate::interfaces::printer::IPrinter;
//
// Implementations
use crate::printer::Printer;

pub fn bootstrap() -> Rc<DIContainer>
{
    let mut di_container = DIContainer::new();

    di_container_bind!(IPrinter<String> => Printer, di_container);
    di_container_bind!(IPrinter<i32> => Printer, di_container);

    di_container
}