From e0f90a8e384615c79d7d51c66d19294d75e79391 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 27 Aug 2022 23:41:41 +0200 Subject: feat: implement named bindings --- examples/named/shuriken.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/named/shuriken.rs (limited to 'examples/named/shuriken.rs') 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!"); + } +} -- cgit v1.2.3-18-g5258