blob: af6df8ab2f8a9a32daa274ce3da5dabf0d45536b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
use std::rc::Rc;
use crate::private::cast::CastFrom;
use crate::ptr::TransientPtr;
/// Interface for a factory.
pub trait IFactory<ReturnInterface, DIContainerT>:
Fn<(Rc<DIContainerT>,), Output = TransientPtr<ReturnInterface>> + CastFrom
where
ReturnInterface: 'static + ?Sized,
{
}
/// Interface for a threadsafe factory.
#[cfg(feature = "async")]
pub trait IThreadsafeFactory<Args, ReturnInterface>:
Fn<Args, Output = TransientPtr<ReturnInterface>> + crate::private::cast::CastFromArc
where
Args: std::marker::Tuple,
ReturnInterface: 'static + ?Sized,
{
}
|