| Crates.io | orion_conf |
| lib.rs | orion_conf |
| version | 0.3.0 |
| created_at | 2025-08-26 02:35:19.053413+00 |
| updated_at | 2025-09-20 02:05:18.670756+00 |
| description | conf storage |
| homepage | |
| repository | https://github.com/galaxy-sec/orion-conf |
| max_upload_size | |
| id | 1810432 |
| size | 73,765 |
Lightweight, feature‑gated config IO for Rust. Enable only the formats you need.
Quick Start
use orion_conf::{ConfigIO, YamlIO};
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Debug, PartialEq)]
struct AppCfg { name: String, value: i32 }
fn main() -> Result<(), Box<dyn std::error::Error>> {
// cargo run --features yaml
let cfg = AppCfg { name: "demo".into(), value: 7 };
let path = std::path::Path::new("app.yaml");
cfg.save_conf(path)?; // delegates by feature priority (YAML > TOML > JSON > INI)
let loaded = AppCfg::load_conf(path)?; // same priority for loading
// Or call the format explicitly
cfg.save_yaml(path)?;
let _ = AppCfg::load_yaml(path)?;
Ok(())
}
Features
yaml, toml, json, iniformats (all), full (all)Key Traits (0.3+)
ConfigIO: unified read/write with feature‑based priorityYamlIO/TomlIO/JsonIO/IniIO: explicit format IOExamples
cargo run --example json_feature_test --features jsoncargo run --example feature_priority_test --features yaml,jsonMigration