diff options
author | HampusM <hampus@hampusmat.com> | 2023-08-03 21:16:42 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-08-03 21:16:42 +0200 |
commit | 02d4820f7c93393d983f12fe157f5b77da317bcd (patch) | |
tree | 2117aeda9deef36325bd0a174b71fc7b41857393 /macros | |
parent | 420cd5a4245aeb9a45dfa0b45c42dd6021857eeb (diff) |
docs: move the injectable macro example section
Diffstat (limited to 'macros')
-rw-r--r-- | macros/src/lib.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 5f5b0b6..18fe3c6 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -79,6 +79,22 @@ const PACKAGE_VERSION: &str = env!("CARGO_PKG_VERSION"); /// You can however also use the concrete type as the interface. As it is declared as such /// by default if the `no_declare_concrete_interface` flag is not set. /// +/// # Examples +/// ``` +/// # use syrette::injectable; +/// # +/// # struct PasswordManager {} +/// # +/// #[injectable] +/// impl PasswordManager +/// { +/// pub fn new() -> Self +/// { +/// Self {} +/// } +/// } +/// ``` +/// /// # Attributes /// Attributes specific to impls with this attribute macro. /// @@ -122,22 +138,6 @@ const PACKAGE_VERSION: &str = env!("CARGO_PKG_VERSION"); /// # impl IKnight for Knight {} /// ``` /// -/// # Example -/// ``` -/// # use syrette::injectable; -/// # -/// # struct PasswordManager {} -/// # -/// #[injectable] -/// impl PasswordManager -/// { -/// pub fn new() -> Self -/// { -/// Self {} -/// } -/// } -/// ``` -/// /// [`DIContainer`]: https://docs.rs/syrette/latest/syrette/di_container/struct.DIContainer.html /// [`AsyncDIContainer`]: https://docs.rs/syrette/latest/syrette/async_di_container/struct.AsyncDIContainer.html /// [`Injectable`]: https://docs.rs/syrette/latest/syrette/interfaces/injectable/trait.Injectable.html |