diff options
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; |