webdesserts-confy

Personal fork of the confy project


Licenses
MIT/X11/Apache-2.0

Documentation

confy

Join the chat at https://gitter.im/rust-clique/confy

Zero-boilerplate configuration management.

Focus on storing the right data, instead of worrying about how to store it.

#[derive(Serialize, Deserialize)]
struct MyConfig {
    version: u8,
    api_key: String,
}

/// `MyConfig` implements `Default`
impl ::std::ops::Default for MyConfig {
    fn default() -> Self { Self { version: 0, api_key: "".into() } }
}

fn main() -> Result<(), ::std::io::Error> {
    let cfg = confy::load("my-app-name")?;
}