diff options
author | HampusM <hampus@hampusmat.com> | 2023-08-20 17:01:12 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-08-20 17:01:12 +0200 |
commit | 0b4232d343e2214ead8fa62583bff2e948173ddf (patch) | |
tree | f809051c9933a132971ab91244e83d1f9d387ad6 /src/di_container/mod.rs | |
parent | be2c39b452b8b1e024300caff1ce8f11d54b27ce (diff) |
feat: expose DI container get_bound methods to public API
Diffstat (limited to 'src/di_container/mod.rs')
-rw-r--r-- | src/di_container/mod.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/di_container/mod.rs b/src/di_container/mod.rs index 5820bc8..63733f5 100644 --- a/src/di_container/mod.rs +++ b/src/di_container/mod.rs @@ -6,5 +6,38 @@ pub mod asynchronous; pub mod blocking; +/// DI container binding options. +/// +/// # Examples +/// ``` +/// # use syrette::di_container::BindingOptions; +/// # +/// BindingOptions::new().name("foo"); +/// ``` +#[derive(Debug, Default, Clone)] +pub struct BindingOptions<'a> +{ + name: Option<&'a str>, +} + +impl<'a> BindingOptions<'a> +{ + /// Returns a new `BindingOptions`. + #[must_use] + pub fn new() -> Self + { + Self { name: None } + } + + /// Returns `Self` with the specified name set. + #[must_use] + pub fn name(mut self, name: &'a str) -> Self + { + self.name = Some(name); + + self + } +} + // Private. pub(crate) mod binding_storage; |