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

use syrette::di_container::blocking::prelude::*;
use syrette::di_container_bind;

use crate::interfaces::printer::IPrinter;
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
}