aboutsummaryrefslogtreecommitdiff
path: root/examples/async/animals/cat.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-08-29 20:52:56 +0200
committerHampusM <hampus@hampusmat.com>2022-08-29 21:01:32 +0200
commit080cc42bb1da09059dbc35049a7ded0649961e0c (patch)
tree307ee564124373616022c1ba2b4d5af80845cd92 /examples/async/animals/cat.rs
parent6e31d8f9e46fece348f329763b39b9c6f2741c07 (diff)
feat: implement async functionality
Diffstat (limited to 'examples/async/animals/cat.rs')
-rw-r--r--examples/async/animals/cat.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/async/animals/cat.rs b/examples/async/animals/cat.rs
new file mode 100644
index 0000000..b1e6f27
--- /dev/null
+++ b/examples/async/animals/cat.rs
@@ -0,0 +1,22 @@
+use syrette::injectable;
+
+use crate::interfaces::cat::ICat;
+
+pub struct Cat {}
+
+#[injectable(ICat, { async = true })]
+impl Cat
+{
+ pub fn new() -> Self
+ {
+ Self {}
+ }
+}
+
+impl ICat for Cat
+{
+ fn meow(&self)
+ {
+ println!("Meow!");
+ }
+}