aboutsummaryrefslogtreecommitdiff
path: root/examples/unbound/animals/cat.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-08-20 18:06:42 +0200
committerHampusM <hampus@hampusmat.com>2022-08-21 18:17:51 +0200
commit55f5e8ca096467be2db895b459760ec34b63fce6 (patch)
treebb34d7f74d5ee7e423e57dbdfd9865d0115b0ff9 /examples/unbound/animals/cat.rs
parent12acab96a7d9ba8032378f8be7b6932f4406a849 (diff)
docs: add example for displaying a unbound interface error
Diffstat (limited to 'examples/unbound/animals/cat.rs')
-rw-r--r--examples/unbound/animals/cat.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/unbound/animals/cat.rs b/examples/unbound/animals/cat.rs
new file mode 100644
index 0000000..153ad4b
--- /dev/null
+++ b/examples/unbound/animals/cat.rs
@@ -0,0 +1,22 @@
+use syrette::injectable;
+
+use crate::interfaces::cat::ICat;
+
+pub struct Cat {}
+
+#[injectable(ICat)]
+impl Cat
+{
+ pub fn new() -> Self
+ {
+ Self {}
+ }
+}
+
+impl ICat for Cat
+{
+ fn meow(&self)
+ {
+ println!("Meow!");
+ }
+}