Expand description
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.
§Functions
§Examples
§Load a configuration using the toml crate
use serde::Deserialize;
#[derive(Deserialize)]
struct Config {
message: String
}
let config: Config = graze::load_from_path("Config.toml", |c| toml::from_str(c))
.expect("Could not load configuration");
println!("{}", config.message);Enums§
- Configuration
Error - The error type returned by functions which return a Result.
Functions§
- load_
from_ path - Load a configuration from the file at the given path.
- load_
or_ default - Load a configuration from the file at the given path, or use the default value if the file does not exist.
- load_
or_ write_ default - Load a configuration from the file at the given path, or use the default value if the file does not exist.