Crate graze

source ·
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

The error type returned by functions which return a Result.

Functions

Load a configuration from the file at the given path.
Load a configuration from the file at the given path, or use the default value if the file does not exist.
Load a configuration from the file at the given path, or use the default value if the file does not exist.

Type Definitions