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/interfaces/any_factory.rs | 11 ----------- src/interfaces/async_injectable.rs | 2 +- src/interfaces/factory.rs | 23 ----------------------- src/interfaces/injectable.rs | 2 +- src/interfaces/mod.rs | 8 -------- 5 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 src/interfaces/any_factory.rs delete mode 100644 src/interfaces/factory.rs (limited to 'src/interfaces') diff --git a/src/interfaces/any_factory.rs b/src/interfaces/any_factory.rs deleted file mode 100644 index e47018b..0000000 --- a/src/interfaces/any_factory.rs +++ /dev/null @@ -1,11 +0,0 @@ -//! Interface for any factory to ever exist. - -use std::fmt::Debug; - -use crate::libs::intertrait::{CastFrom, CastFromSync}; - -/// Interface for any factory to ever exist. -pub trait AnyFactory: CastFrom + Debug {} - -/// Interface for any threadsafe factory to ever exist. -pub trait AnyThreadsafeFactory: CastFromSync + Debug {} diff --git a/src/interfaces/async_injectable.rs b/src/interfaces/async_injectable.rs index 4e614a3..e6a050e 100644 --- a/src/interfaces/async_injectable.rs +++ b/src/interfaces/async_injectable.rs @@ -6,7 +6,7 @@ use crate::dependency_history::IDependencyHistory; use crate::di_container::asynchronous::IAsyncDIContainer; use crate::errors::injectable::InjectableError; use crate::future::BoxFuture; -use crate::libs::intertrait::CastFromSync; +use crate::private::cast::CastFromSync; use crate::ptr::TransientPtr; /// Interface for structs that can be injected into or be injected to. diff --git a/src/interfaces/factory.rs b/src/interfaces/factory.rs deleted file mode 100644 index c67abd6..0000000 --- a/src/interfaces/factory.rs +++ /dev/null @@ -1,23 +0,0 @@ -use std::marker::Tuple; - -use crate::libs::intertrait::CastFrom; -use crate::ptr::TransientPtr; - -/// Interface for a factory. -pub trait IFactory: - Fn> + CastFrom -where - Args: Tuple, - ReturnInterface: 'static + ?Sized, -{ -} - -/// Interface for a threadsafe factory. -#[cfg(feature = "async")] -pub trait IThreadsafeFactory: - Fn> + crate::libs::intertrait::CastFromSync -where - Args: Tuple, - ReturnInterface: 'static + ?Sized, -{ -} diff --git a/src/interfaces/injectable.rs b/src/interfaces/injectable.rs index 6130d2b..b70e13f 100644 --- a/src/interfaces/injectable.rs +++ b/src/interfaces/injectable.rs @@ -5,7 +5,7 @@ use std::rc::Rc; use crate::dependency_history::IDependencyHistory; use crate::di_container::blocking::IDIContainer; use crate::errors::injectable::InjectableError; -use crate::libs::intertrait::CastFrom; +use crate::private::cast::CastFrom; use crate::ptr::TransientPtr; /// Interface for structs that can be injected into or be injected to. diff --git a/src/interfaces/mod.rs b/src/interfaces/mod.rs index 9815a11..e7068ad 100644 --- a/src/interfaces/mod.rs +++ b/src/interfaces/mod.rs @@ -2,14 +2,6 @@ pub mod injectable; -#[cfg(feature = "factory")] -#[doc(hidden)] -pub mod any_factory; - -#[cfg(feature = "factory")] -#[doc(hidden)] -pub mod factory; - #[cfg(feature = "async")] #[cfg_attr(doc_cfg, doc(cfg(feature = "async")))] pub mod async_injectable; -- cgit v1.2.3-18-g5258