rtb-config 0.6.2

Layered, typed configuration backed by figment. Part of the phpboyscout Rust toolkit.
Documentation

rtb-config

Part of the phpboyscout Rust toolkit — small, framework-free crates extracted from rust-tool-base.

Typed, layered configuration backed by figment. Declare a serde::Deserialize struct, layer embedded defaults, user files, and prefixed env vars over it, and read atomically-swapped Arc snapshots — no get_string("foo.bar") dynamic accessors, ever.

use rtb_config::Config;
use serde::Deserialize;

#[derive(Deserialize, Default)]
struct MyConfig { host: String, port: u16 }

let cfg = Config::<MyConfig>::builder()
    .embedded_default("host: localhost\nport: 8080\n")
    .env_prefixed("MYTOOL_")
    .build()?;

let current = cfg.get();
assert_eq!(current.port, 8080);

Optional features: hot-reload (debounced file watcher that reloads on change) and mutable (Config::schema() / Config::write() for config set / schema / validate style subcommands).

Development

just ci runs the full local gate (fmt, clippy, nextest, doc, deny). Tests include a cucumber BDD suite (tests/bdd.rs). Releases are cut by release-plz from Conventional Commits — do not tag manually.

License

MIT