1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//! # diode-base
//!
//! Base functionality and utilities for diode applications, providing essential
//! building blocks for creating robust, configurable, and maintainable services.
//!
//! This crate extends the core diode dependency injection framework with
//! practical utilities for real-world applications including configuration management,
//! daemon services, command-line interfaces, and application lifecycle management.
//!
//! ## Core Components
//!
//! - **Configuration System**: Type-safe configuration loading and merging from multiple sources
//! - **Daemon Framework**: Long-running background services with graceful shutdown
//! - **Command System**: CLI framework with subcommands and dependency injection
//! - **Bundle Management**: Modular application component grouping
//! - **Tracing Integration**: Structured logging and observability
//! - **Dynamic Configuration**: Runtime configuration updates and hot-reloading
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use diode::App;
//! use diode_base::{RunMainExt, AddCommandExt, Command};
//! use std::process::ExitCode;
//! use std::sync::Arc;
//! use clap::Command as ClapCommand;
//!
//! struct HelloCommand;
//!
//! impl Command for HelloCommand {
//! fn command() -> ClapCommand {
//! ClapCommand::new("hello").about("Says hello")
//! }
//!
//! async fn main(_app: Arc<App>, _matches: clap::ArgMatches) -> ExitCode {
//! println!("Hello from diode!");
//! ExitCode::SUCCESS
//! }
//! }
//!
//! #[tokio::main]
//! async fn main() -> ExitCode {
//! App::builder()
//! .add_command::<HelloCommand>()
//! .run_main()
//! .await
//! }
//! ```
//!
//! ## Configuration Example
//!
//! ```rust
//! use diode::App;
//! use diode_base::Config;
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Debug, Serialize, Deserialize)]
//! struct DatabaseConfig {
//! host: String,
//! port: u16,
//! }
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
//! let app = App::builder()
//! .add_component(Config::new().with("database", DatabaseConfig {
//! host: "localhost".to_string(),
//! port: 5432,
//! }))
//! .build()
//! .await?;
//!
//! let config = app.get_component_ref::<Config>().unwrap();
//! let db_config = config.get::<DatabaseConfig>("database")?;
//! println!("Database: {}:{}", db_config.host, db_config.port);
//! # Ok(())
//! # }
//! ```
//!
//! ## Features
//!
//! - `macros` (default): Enables procedural macros for simplified configuration and service definitions
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use async_trait;