aboutsummaryrefslogtreecommitdiff
path: root/examples/async/interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'examples/async/interfaces')
-rw-r--r--examples/async/interfaces/food.rs10
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>;