From 50ab663284fa31e805a7afef5834a55393812a49 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 18 Jul 2022 21:19:10 +0200 Subject: docs: remove the crate root example --- syrette/src/lib.rs | 113 ----------------------------------------------------- 1 file changed, 113 deletions(-) diff --git a/syrette/src/lib.rs b/syrette/src/lib.rs index 40cbb83..aee7fe2 100644 --- a/syrette/src/lib.rs +++ b/syrette/src/lib.rs @@ -3,119 +3,6 @@ //! Syrette //! //! Syrette is a collection of utilities useful for performing dependency injection. -//! -//! # Examples -//! ``` -//! use syrette::errors::di_container::DIContainerError; -//! use syrette::{injectable, DIContainer}; -//! -//! trait IDog -//! { -//! fn woof(&self); -//! } -//! -//! struct Dog {} -//! -//! #[injectable(IDog)] -//! impl Dog -//! { -//! fn new() -> Self -//! { -//! Self {} -//! } -//! } -//! -//! impl IDog for Dog -//! { -//! fn woof(&self) -//! { -//! println!("Woof!"); -//! } -//! } -//! -//! trait ICat -//! { -//! fn meow(&self); -//! } -//! -//! struct Cat {} -//! -//! #[injectable(ICat)] -//! impl Cat -//! { -//! fn new() -> Self -//! { -//! Self {} -//! } -//! } -//! -//! impl ICat for Cat -//! { -//! fn meow(&self) -//! { -//! println!("Meow!"); -//! } -//! } -//! -//! trait IHuman -//! { -//! fn make_pets_make_sounds(&self); -//! } -//! -//! struct Human -//! { -//! _dog: Box, -//! _cat: Box, -//! } -//! -//! #[injectable(IHuman)] -//! impl Human -//! { -//! fn new(dog: Box, cat: Box) -> Self -//! { -//! Self { -//! _dog: dog, -//! _cat: cat, -//! } -//! } -//! } -//! -//! impl IHuman for Human -//! { -//! fn make_pets_make_sounds(&self) -//! { -//! println!("Hi doggy!"); -//! -//! self._dog.woof(); -//! -//! println!("Hi kitty!"); -//! -//! self._cat.meow(); -//! } -//! } -//! -//! fn main() -> error_stack::Result<(), DIContainerError> -//! { -//! println!("Hello, world!"); -//! -//! let mut di_container: DIContainer = DIContainer::new(); -//! -//! di_container.bind::().to::(); -//! di_container.bind::().to::(); -//! di_container.bind::().to::(); -//! -//! let dog = di_container.get::()?; -//! -//! dog.woof(); -//! -//! let human = di_container.get::()?; -//! -//! human.make_pets_make_sounds(); -//! -//! Ok(()) -//! } -//! -//! ``` pub mod castable_factory; pub mod di_container; -- cgit v1.2.3-18-g5258