diff options
author | HampusM <hampus@hampusmat.com> | 2022-08-27 23:41:41 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-27 23:41:41 +0200 |
commit | e0f90a8e384615c79d7d51c66d19294d75e79391 (patch) | |
tree | f3df3d1cd92f7d4a978feaa5a9a5f773dd0901ee /examples/named/shuriken.rs | |
parent | d4078c84a83d121a4e3492955359cedb3b404476 (diff) |
feat: implement named bindings
Diffstat (limited to 'examples/named/shuriken.rs')
-rw-r--r-- | examples/named/shuriken.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/named/shuriken.rs b/examples/named/shuriken.rs new file mode 100644 index 0000000..c50aeac --- /dev/null +++ b/examples/named/shuriken.rs @@ -0,0 +1,22 @@ +use syrette::injectable; + +use crate::interfaces::weapon::IWeapon; + +pub struct Shuriken {} + +#[injectable(IWeapon)] +impl Shuriken +{ + pub fn new() -> Self + { + Self {} + } +} + +impl IWeapon for Shuriken +{ + fn use_it(&self) + { + println!("Used shuriken!"); + } +} |