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
//! [](./LICENSE)
//! [](https://crates.io/crates/cdumay_config)
//! [](https://docs.rs/cdumay_config)
//! [](https://github.com/cdumay/cdumay_config)
//!
//! A flexible configuration management library that provides a trait-based approach for handling
//! key-value data with support of multiple serialization formats.
//!
//! # Features
//!
//! - Generic configuration management through the `Manager` trait
//! - Support for multiple serialization formats (with feature flags):
//! - JSON (default)
//! - TOML (feature: "toml")
//! - YAML (feature: "yaml")
//! - XML (feature: "xml")
//! - Type-safe error handling with the `cdumay_core::Error` struct
//!
//! # Example Usage
//!
//! ```rust
//! #[derive(Debug, serde::Serialize, serde::Deserialize)]
//! pub struct DatabaseConfig {
//! pub user: String,
//! pub password: String,
//! pub database: String,
//! }
//!
//! fn main() -> cdumay_core::Result<()> {
//! let context = std::collections::BTreeMap::new();
//! let config = DatabaseConfig {
//! user: "john".to_string(),
//! password: "smith".to_string(),
//! database: "example".to_string()
//! };
//! let _ = cdumay_config::write_config(
//! "locker-db.json",
//! Some(cdumay_config::ContentFormat::JSON),
//! config,
//! &context
//! )?;
//! Ok(())
//! }
//! ```
//!
pub use *;
pub use *;
pub use *;