16 releases

0.2.3 Apr 12, 2024
0.2.2 Sep 15, 2023
0.2.0 Apr 17, 2023
0.1.0 Jan 11, 2023
0.0.1 Mar 28, 2022

#832 in Configuration

21 downloads per month

MIT license

16KB
396 lines

Example of usage

use serde::{Deserialize, Serialize};

pub const DEFAULT_CONFIG: &str = include_str!("../config.yaml");

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Config {
    pub port: u16,
    pub dry_run_mode: bool
}

impl Config {
    pub fn load() -> Result<Self, pepe_config::ConfigError> {
        pepe_config::load(DEFAULT_CONFIG, pepe_config::FileFormat::Yaml)
    }
}

Dependencies

~2.1–3MB
~63K SLoC