From fda37d21782f7f343203521f7254f1e70f89b1ed Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 15 Mar 2020 22:12:56 +0530 Subject: add sample usage --- readme.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d3f4ad8 --- /dev/null +++ b/readme.md @@ -0,0 +1,22 @@ +# fondant + +> an experimental, macro-only, boilerplate free, configuration management library + +### example + +```rust +#[derive(Config, Default, Serialize, Deserialize)] +#[filename = "config"] // ~/.config/appconfig/config.toml (XDG spec) +#[extension = "toml"] // possible values: yaml, toml, json +struct AppConfig { + version: u8, + path: String, +} + +fn main() { + let mut config = AppConfig::load().unwrap(); + config.version = 3; + config.path = "/home/np".to_string(); + config.store(); +} +``` -- cgit v1.2.3