Crates.io | graze |
lib.rs | graze |
version | 0.1.0 |
source | src |
created_at | 2022-11-24 06:13:58.431272 |
updated_at | 2022-11-24 06:13:58.431272 |
description | A zero-boilerplate configuration library. |
homepage | |
repository | https://github.com/ImajinDevon/graze |
max_upload_size | |
id | 722019 |
size | 10,523 |
graze
?graze
is a zero-boilerplate configuration library.
graze
itself does not use serde as a dependency, but can
easily be used alongside the serde ecosystem.
load_from_path
load_or_default
load_or_write_default
use serde::Deserialize;
#[derive(Deserialize)]
struct Config {
message: String
}
fn main() {
let config = graze::load_from_path("Config.toml", |c| toml::from_str(c))
.expect("Could not load configuration");
println!("{}", config.message);
}