diff options
-rw-r--r-- | readme.md | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d3f4ad8 --- /dev/null +++ b/readme.md | |||
@@ -0,0 +1,22 @@ | |||
1 | # fondant | ||
2 | |||
3 | > an experimental, macro-only, boilerplate free, configuration management library | ||
4 | |||
5 | ### example | ||
6 | |||
7 | ```rust | ||
8 | #[derive(Config, Default, Serialize, Deserialize)] | ||
9 | #[filename = "config"] // ~/.config/appconfig/config.toml (XDG spec) | ||
10 | #[extension = "toml"] // possible values: yaml, toml, json | ||
11 | struct AppConfig { | ||
12 | version: u8, | ||
13 | path: String, | ||
14 | } | ||
15 | |||
16 | fn main() { | ||
17 | let mut config = AppConfig::load().unwrap(); | ||
18 | config.version = 3; | ||
19 | config.path = "/home/np".to_string(); | ||
20 | config.store(); | ||
21 | } | ||
22 | ``` | ||