aboutsummaryrefslogtreecommitdiff
path: root/examples/async/interfaces/food.rs
blob: 9d88083838cf7c8a30bc575e8e82787cd9fdd2be (plain)
1
2
3
4
5
6
7
8
9
10
use syrette::factory;
use syrette::ptr::TransientPtr;

pub trait IFood: Send + Sync
{
    fn eat(&self);
}

#[factory(threadsafe = true)]
pub type IFoodFactory = dyn Fn() -> TransientPtr<dyn IFood> + Send + Sync;