From 9f27a925bd323e8e0864bedeb33a3c6953517ea1 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 19 Nov 2022 15:45:12 +0100 Subject: refactor: reorganize non-public API items --- src/di_container/asynchronous/binding/builder.rs | 8 ++++---- src/di_container/asynchronous/mod.rs | 17 +++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/di_container/asynchronous') diff --git a/src/di_container/asynchronous/binding/builder.rs b/src/di_container/asynchronous/binding/builder.rs index 3ea8a35..8ba5be3 100644 --- a/src/di_container/asynchronous/binding/builder.rs +++ b/src/di_container/asynchronous/binding/builder.rs @@ -191,7 +191,7 @@ where FactoryFunc: Fn<(Arc,), Output = BoxFn> + Send + Sync, { - use crate::castable_factory::threadsafe::ThreadsafeCastableFactory; + use crate::private::castable_factory::threadsafe::ThreadsafeCastableFactory; use crate::provider::r#async::AsyncFactoryVariant; if self.di_container.has_binding::(None).await { @@ -288,7 +288,7 @@ where > + Send + Sync, { - use crate::castable_factory::threadsafe::ThreadsafeCastableFactory; + use crate::private::castable_factory::threadsafe::ThreadsafeCastableFactory; use crate::provider::r#async::AsyncFactoryVariant; if self.di_container.has_binding::(None).await { @@ -378,7 +378,7 @@ where > + Send + Sync, { - use crate::castable_factory::threadsafe::ThreadsafeCastableFactory; + use crate::private::castable_factory::threadsafe::ThreadsafeCastableFactory; use crate::provider::r#async::AsyncFactoryVariant; if self.di_container.has_binding::(None).await { @@ -472,7 +472,7 @@ where > + Send + Sync, { - use crate::castable_factory::threadsafe::ThreadsafeCastableFactory; + use crate::private::castable_factory::threadsafe::ThreadsafeCastableFactory; use crate::provider::r#async::AsyncFactoryVariant; if self.di_container.has_binding::(None).await { diff --git a/src/di_container/asynchronous/mod.rs b/src/di_container/asynchronous/mod.rs index 65f5c9e..ad1f44f 100644 --- a/src/di_container/asynchronous/mod.rs +++ b/src/di_container/asynchronous/mod.rs @@ -62,8 +62,9 @@ use crate::di_container::asynchronous::binding::builder::AsyncBindingBuilder; use crate::di_container::binding_storage::DIContainerBindingStorage; use crate::errors::async_di_container::AsyncDIContainerError; use crate::future::BoxFuture; -use crate::libs::intertrait::cast::error::CastError; -use crate::libs::intertrait::cast::{CastArc, CastBox}; +use crate::private::cast::arc::CastArc; +use crate::private::cast::boxed::CastBox; +use crate::private::cast::error::CastError; use crate::provider::r#async::{AsyncProvidable, IAsyncProvider}; use crate::ptr::{SomeThreadsafePtr, TransientPtr}; @@ -286,7 +287,7 @@ impl AsyncDIContainer } #[cfg(feature = "factory")] AsyncProvidable::Factory(factory_binding) => { - use crate::interfaces::factory::IThreadsafeFactory; + use crate::private::factory::IThreadsafeFactory; let factory = factory_binding .cast::,), Interface>>() @@ -315,7 +316,7 @@ impl AsyncDIContainer } #[cfg(feature = "factory")] AsyncProvidable::DefaultFactory(binding) => { - use crate::interfaces::factory::IThreadsafeFactory; + use crate::private::factory::IThreadsafeFactory; let default_factory = Self::cast_factory_binding::< dyn IThreadsafeFactory< @@ -328,7 +329,7 @@ impl AsyncDIContainer } #[cfg(feature = "factory")] AsyncProvidable::AsyncDefaultFactory(binding) => { - use crate::interfaces::factory::IThreadsafeFactory; + use crate::private::factory::IThreadsafeFactory; let async_default_factory = Self::cast_factory_binding::< dyn IThreadsafeFactory< @@ -350,7 +351,7 @@ impl AsyncDIContainer #[cfg(feature = "factory")] fn cast_factory_binding( - factory_binding: Arc, + factory_binding: Arc, binding_kind: &'static str, ) -> Result, AsyncDIContainerError> { @@ -667,7 +668,7 @@ mod tests } use crate as syrette; - use crate::castable_factory::threadsafe::ThreadsafeCastableFactory; + use crate::private::castable_factory::threadsafe::ThreadsafeCastableFactory; #[crate::factory(threadsafe = true)] type IUserManagerFactory = dyn Fn(Vec) -> dyn IUserManager; @@ -762,7 +763,7 @@ mod tests } use crate as syrette; - use crate::castable_factory::threadsafe::ThreadsafeCastableFactory; + use crate::private::castable_factory::threadsafe::ThreadsafeCastableFactory; #[crate::factory(threadsafe = true)] type IUserManagerFactory = dyn Fn(Vec) -> dyn IUserManager; -- cgit v1.2.3-18-g5258