Crates.io | cdumay_config |
lib.rs | cdumay_config |
version | 0.1.5 |
created_at | 2025-05-15 10:58:21.882185+00 |
updated_at | 2025-06-19 10:10:31.513386+00 |
description | A Rust Library for configuration manipulation and export |
homepage | https://github.com/cdumay/cdumay_config |
repository | https://github.com/cdumay/cdumay_config |
max_upload_size | |
id | 1674795 |
size | 75,977 |
A flexible configuration management library that provides a trait-based approach for handling key-value data with support of multiple serialization formats.
Manager
traitcdumay_core::Error
struct#[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(())
}