From 7a6575220c6d9db564514bcbee552faa29095738 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 31 Jul 2022 17:27:33 +0200 Subject: docs: add doc comments & deny missing docs --- src/interfaces/any_factory.rs | 3 +++ src/interfaces/factory.rs | 11 +++++++++++ src/interfaces/injectable.rs | 2 ++ src/interfaces/mod.rs | 2 ++ 4 files changed, 18 insertions(+) (limited to 'src/interfaces') diff --git a/src/interfaces/any_factory.rs b/src/interfaces/any_factory.rs index 41063e1..98ec144 100644 --- a/src/interfaces/any_factory.rs +++ b/src/interfaces/any_factory.rs @@ -1,3 +1,6 @@ +//! Interface for any factory to ever exist. + use crate::libs::intertrait::CastFrom; +/// Interface for any factory to ever exist. pub trait AnyFactory: CastFrom {} diff --git a/src/interfaces/factory.rs b/src/interfaces/factory.rs index 6f8e7c7..d3d55da 100644 --- a/src/interfaces/factory.rs +++ b/src/interfaces/factory.rs @@ -1,7 +1,18 @@ #![allow(clippy::module_name_repetitions)] + +//! Interface for a factory. + use crate::libs::intertrait::CastFrom; use crate::ptr::TransientPtr; +/// Interface for a factory. +/// +/// # Examples +/// ``` +/// use syrette::interface::factory::IFactory; +/// +/// type StringFactory = dyn IFactory<(), String>; +/// ``` pub trait IFactory: Fn> + CastFrom where diff --git a/src/interfaces/injectable.rs b/src/interfaces/injectable.rs index 0af1217..31cd21b 100644 --- a/src/interfaces/injectable.rs +++ b/src/interfaces/injectable.rs @@ -1,8 +1,10 @@ +//! Interface for structs that can be injected into or be injected to. use crate::errors::injectable::ResolveError; use crate::libs::intertrait::CastFrom; use crate::ptr::TransientPtr; use crate::DIContainer; +/// Interface for structs that can be injected into or be injected to. pub trait Injectable: CastFrom { /// Resolves the dependencies of the injectable. diff --git a/src/interfaces/mod.rs b/src/interfaces/mod.rs index 497521e..eef7190 100644 --- a/src/interfaces/mod.rs +++ b/src/interfaces/mod.rs @@ -1,3 +1,5 @@ +//! Various useful interfaces. + pub mod any_factory; pub mod injectable; -- cgit v1.2.3-18-g5258