diff options
Diffstat (limited to 'examples/async/animals/dog.rs')
-rw-r--r-- | examples/async/animals/dog.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/async/animals/dog.rs b/examples/async/animals/dog.rs new file mode 100644 index 0000000..d1b33f9 --- /dev/null +++ b/examples/async/animals/dog.rs @@ -0,0 +1,22 @@ +use syrette::injectable; + +use crate::interfaces::dog::IDog; + +pub struct Dog {} + +#[injectable(IDog, { async = true })] +impl Dog +{ + pub fn new() -> Self + { + Self {} + } +} + +impl IDog for Dog +{ + fn woof(&self) + { + println!("Woof!"); + } +} |