17 releases
new 0.2.6 | Feb 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 |
#415 in Configuration
161 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
~4MB
~91K SLoC