aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/any_factory.rs
blob: 1bf92087db2704957258bd5ee241ff58a30f1f43 (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
25
26
27
//! 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 {}

impl Debug for dyn AnyFactory
{
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
    {
        f.write_str("{}")
    }
}

/// Interface for any threadsafe factory to ever exist.
pub trait AnyThreadsafeFactory: CastFromSync {}

impl Debug for dyn AnyThreadsafeFactory
{
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result
    {
        f.write_str("{}")
    }
}