Crates.io | pepe-config |
lib.rs | pepe-config |
version | 0.2.3 |
source | src |
created_at | 2022-03-28 13:53:26.90863 |
updated_at | 2024-04-12 13:44:15.552312 |
description | Configuration functions for PepeTeam template application |
homepage | https://pepe.team |
repository | https://github.com/crypto-pepe/pepe-rs |
max_upload_size | |
id | 557834 |
size | 15,168 |
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)
}
}