From 18f60ba07893c79100c8c576a717059f3da33c84 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 21 Jul 2022 19:50:42 +0200 Subject: docs: rename example folder to examples --- example/src/animals/human.rs | 49 -------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 example/src/animals/human.rs (limited to 'example/src/animals/human.rs') diff --git a/example/src/animals/human.rs b/example/src/animals/human.rs deleted file mode 100644 index 5bd2f8f..0000000 --- a/example/src/animals/human.rs +++ /dev/null @@ -1,49 +0,0 @@ -use syrette::injectable; -use syrette::ptr::{FactoryPtr, InterfacePtr}; - -use crate::interfaces::cat::ICat; -use crate::interfaces::cow::{CowFactory, ICow}; -use crate::interfaces::dog::IDog; -use crate::interfaces::human::IHuman; - -pub struct Human -{ - dog: InterfacePtr, - cat: InterfacePtr, - cow_factory: FactoryPtr, -} - -#[injectable(IHuman)] -impl Human -{ - pub fn new( - dog: InterfacePtr, - cat: InterfacePtr, - cow_factory: FactoryPtr, - ) -> Self - { - Self { - dog, - cat, - cow_factory, - } - } -} - -impl IHuman for Human -{ - fn make_pets_make_sounds(&self) - { - println!("Hi doggy!"); - - self.dog.woof(); - - println!("Hi kitty!"); - - self.cat.meow(); - - let cow: Box = (self.cow_factory)(3); - - cow.moo(); - } -} -- cgit v1.2.3-18-g5258