aboutsummaryrefslogtreecommitdiff
path: root/src/ptr.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-08-25 20:46:14 +0200
committerHampusM <hampus@hampusmat.com>2022-08-27 14:29:42 +0200
commitd4078c84a83d121a4e3492955359cedb3b404476 (patch)
treef31fef99fcee6ffd537b7d7adf7981851966feda /src/ptr.rs
parent626e9e56c23863dce33ef211fa51e49cc5fb48e1 (diff)
refactor!: limit FactoryPtr & AnyFactory to the factory feature
BREAKING CHANGE: FactoryPtr has been limited to the factory feature
Diffstat (limited to 'src/ptr.rs')
-rw-r--r--src/ptr.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ptr.rs b/src/ptr.rs
index 08c3788..6f93fee 100644
--- a/src/ptr.rs
+++ b/src/ptr.rs
@@ -14,6 +14,7 @@ pub type TransientPtr<Interface> = Box<Interface>;
pub type SingletonPtr<Interface> = Rc<Interface>;
/// A smart pointer to a factory.
+#[cfg(feature = "factory")]
pub type FactoryPtr<FactoryInterface> = Rc<FactoryInterface>;
/// Some smart pointer.
@@ -29,6 +30,7 @@ where
Singleton(SingletonPtr<Interface>),
/// A smart pointer to a factory.
+ #[cfg(feature = "factory")]
Factory(FactoryPtr<Interface>),
}
@@ -63,5 +65,7 @@ where
{
create_as_variant_fn!(Transient);
create_as_variant_fn!(Singleton);
+
+ #[cfg(feature = "factory")]
create_as_variant_fn!(Factory);
}