aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index cac6ffe..8908143 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -38,6 +38,30 @@ mod provider;
///
/// # Arguments
/// {interface} => {implementation}, {DI container variable name}
+///
+/// # Examples
+/// ```
+/// # use syrette::{di_container_bind, DIContainer, injectable};
+/// #
+/// # trait INinja {}
+/// #
+/// # struct Ninja {}
+/// #
+/// # #[injectable]
+/// # impl Ninja
+/// # {
+/// # fn new() -> Self
+/// # {
+/// # Self {}
+/// # }
+/// # }
+/// #
+/// # impl INinja for Ninja {}
+/// #
+/// let mut di_container = DIContainer::new();
+///
+/// di_container_bind!(INinja => Ninja, di_container);
+/// ```
#[macro_export]
macro_rules! di_container_bind {
($interface: path => $implementation: ty, $di_container: ident) => {
@@ -62,8 +86,8 @@ macro_rules! di_container_bind {
///
/// # Examples
/// ```
-/// use syrette::declare_default_factory;
-///
+/// # use syrette::declare_default_factory;
+/// #
/// trait IParser
/// {
/// // Methods and etc here...
@@ -75,8 +99,8 @@ macro_rules! di_container_bind {
/// The expanded equivelent of this would be
///
/// ```
-/// use syrette::declare_default_factory;
-///
+/// # use syrette::declare_default_factory;
+/// #
/// trait IParser {
/// // Methods and etc here...
/// }