#[cfg(feature = "async")] use std::sync::Arc; use crate::private::cast::CastFrom; use crate::ptr::TransientPtr; /// Interface for a factory. pub trait IFactory: CastFrom where ReturnInterface: 'static + ?Sized, { fn call(&self, di_container: &DIContainerT) -> TransientPtr; } /// Interface for a threadsafe factory. #[cfg(feature = "async")] pub trait IThreadsafeFactory: Fn<(Arc,), Output = TransientPtr> + crate::private::cast::CastFromArc where ReturnInterface: 'static + ?Sized, { }