pepe-config

Crates.iopepe-config
lib.rspepe-config
version0.2.3
sourcesrc
created_at2022-03-28 13:53:26.90863
updated_at2024-04-12 13:44:15.552312
descriptionConfiguration functions for PepeTeam template application
homepagehttps://pepe.team
repositoryhttps://github.com/crypto-pepe/pepe-rs
max_upload_size
id557834
size15,168
saehrimnir (stupid-boar)

documentation

README

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)
    }
}
Commit count: 0

cargo fmt