dumbo_config

Crates.iodumbo_config
lib.rsdumbo_config
version0.2.1
created_at2025-06-30 07:17:01.210592+00
updated_at2025-07-22 10:31:52.509171+00
descriptiona config loader
homepage
repositoryhttps://github.com/cao5zy/dumbo-config
max_upload_size
id1731497
size9,122
zong-ying.cao (cao5zy)

documentation

https://docs.rs/dumbo_config

README

dumbo-config

dumbo-config is a config loader.

Features

  • Load project configurations

Quick Start

Your configuration file.

name: "test config"
value: 32

configuration file name

The following file names is qualified.

  • config.yml
  • config.yaml
  • config.{ENV}.yml
  • config.{ENV}.yaml Where ENV is the value of the environment variable "ENV". If "ENV" is not set, it defaults to searching config.yml and config.yaml.

You can also use load_named_config with specified config file.

Rust file for loading TestConfig

use dumbo_config::{load_config, load_named_config};
use serde::Deserialize;

#[derive(Debug, Deserialize, PartialEq)]
struct TestConfig {
    name: String,
    value: i32,
}

...

let config: Option<TestConfig> = load_config();

let config_path: Path = ...;

let config: Option<TestConfig> = load_named_config(&config_path);
Commit count: 0

cargo fmt