18 releases
| 0.2.7 | Mar 28, 2025 |
|---|---|
| 0.2.3 | Apr 12, 2024 |
| 0.2.2 | Sep 15, 2023 |
| 0.2.0 | Apr 17, 2023 |
| 0.0.1 | Mar 28, 2022 |
#5 in #default-config
915 downloads per month
17KB
425 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)
}
}
Tests
Should be run in 1 thread due to environment variables usage.
cargo test -- --test-threads 1
Dependencies
~2.3–3MB
~76K SLoC