diff options
author | HampusM <hampus@hampusmat.com> | 2023-08-31 19:19:06 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-08-31 19:19:06 +0200 |
commit | 7bed48c852a741df5a14359916faf21d90d39814 (patch) | |
tree | 5cc94835225d356ed658cf78a99deeb1b4e730f8 /src/test_utils.rs | |
parent | 0b4232d343e2214ead8fa62583bff2e948173ddf (diff) |
refactor: pass around BindingOptions instead of name
Diffstat (limited to 'src/test_utils.rs')
-rw-r--r-- | src/test_utils.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/test_utils.rs b/src/test_utils.rs index 1e0e04d..a304a71 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -289,6 +289,7 @@ pub mod mocks use crate::di_container::blocking::binding::builder::BindingBuilder; use crate::di_container::blocking::details::DIContainerInternals; use crate::di_container::blocking::{BindingOptionsWithLt, IDIContainer}; + use crate::di_container::BindingOptions; use crate::errors::di_container::DIContainerError; use crate::provider::blocking::IProvider; use crate::ptr::SomePtr; @@ -328,21 +329,24 @@ pub mod mocks impl DIContainerInternals for DIContainer { - fn has_binding<Interface>(self: &Rc<Self>, name: Option<&'static str>) -> bool + fn has_binding<Interface>( + self: &Rc<Self>, + binding_options: BindingOptionsWithLt + ) -> bool where Interface: ?Sized + 'static; #[doc(hidden)] fn set_binding<Interface>( self: &Rc<Self>, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, provider: Box<dyn IProvider<Self>>, ) where Interface: 'static + ?Sized; fn remove_binding<Interface>( self: &Rc<Self>, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, ) -> Option<Box<dyn IProvider<Self>>> where Interface: 'static + ?Sized; @@ -406,21 +410,21 @@ pub mod mocks { async fn has_binding<Interface>( self: &Arc<Self>, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, ) -> bool where Interface: ?Sized + 'static; async fn set_binding<Interface>( self: &Arc<Self>, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, provider: Box<dyn IAsyncProvider<Self>>, ) where Interface: 'static + ?Sized; async fn remove_binding<Interface>( self: &Arc<Self>, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, ) -> Option<Box<dyn IAsyncProvider<Self>>> where Interface: 'static + ?Sized; |