aboutsummaryrefslogtreecommitdiff
path: root/examples/generics/bootstrap.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/generics/bootstrap.rs')
-rw-r--r--examples/generics/bootstrap.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/generics/bootstrap.rs b/examples/generics/bootstrap.rs
new file mode 100644
index 0000000..072350e
--- /dev/null
+++ b/examples/generics/bootstrap.rs
@@ -0,0 +1,17 @@
+use syrette::{di_container_bind, DIContainer};
+
+// Interfaces
+use crate::interfaces::printer::IPrinter;
+//
+// Implementations
+use crate::printer::Printer;
+
+pub fn bootstrap() -> 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
+}