blob: 29b9f0810f019044921d80c7c0e59ae3e998d5e5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#![allow(clippy::module_name_repetitions)]
//! Interface for a factory.
//!
//! ---
//!
//! *This module is only available if Syrette is built with the "factory" feature.*
use crate::libs::intertrait::CastFrom;
use crate::ptr::TransientPtr;
/// Interface for a factory.
///
/// # Examples
/// ```
/// use syrette::interface::factory::IFactory;
///
/// type StringFactory = dyn IFactory<(), String>;
/// ```
pub trait IFactory<Args, ReturnInterface>:
Fn<Args, Output = TransientPtr<ReturnInterface>> + CastFrom
where
ReturnInterface: 'static + ?Sized,
{
}
|