aboutsummaryrefslogtreecommitdiff
path: root/readme.md
blob: d3f4ad8992d590b86ec45d89e24f264b74e74ee4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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();
}
```