diff options
author | HampusM <hampus@hampusmat.com> | 2022-09-17 18:37:30 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-09-17 18:37:30 +0200 |
commit | e210a95b9724bf9c471090d629c5962e3e411711 (patch) | |
tree | 3a064e34ad1dd61bcd25fbd5fda72ddacd847f53 /examples/async/interfaces | |
parent | 7de7f73963a266cceff85d6ab71c3256e5d382ec (diff) |
docs: add missing modules in the async example
Diffstat (limited to 'examples/async/interfaces')
-rw-r--r-- | examples/async/interfaces/food.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/async/interfaces/food.rs b/examples/async/interfaces/food.rs new file mode 100644 index 0000000..b310a3d --- /dev/null +++ b/examples/async/interfaces/food.rs @@ -0,0 +1,10 @@ +use syrette::factory; +use syrette::ptr::TransientPtr; + +pub trait IFood +{ + fn eat(&self); +} + +#[factory(threadsafe = true)] +pub type IFoodFactory = dyn Fn() -> TransientPtr<dyn IFood>; |