Twenty-six of them, each showing one idea. All run from the workspace root.
| Example | Features | Shows |
basic | json | Load once, read the snapshot. |
sections | json, watch | Several config types over one set of files, each owning its own key, files and watcher. |
errors | json | Every ErrorKind, what each one calls for, and reading path and origin. |
| Example | Features | Shows |
layers | json | One key climbing all five layers, with source_of naming each. |
env_only | json | No files at all: the 12-factor arrangement, nested and list values included. |
discovery | json | name + paths across two directories, plus a profile overlay. |
cli | clap, json | Flags over the environment, --set key=value, and --check instead of booting. |
| Example | Features | Shows |
hot_reload | watch, toml | Edit a file and watch the snapshot follow. |
async_reload | async, watch, json | A task awaiting reloads instead of polling for them. |
group | json | Two config types reloading as one step, or not at all. |
| Example | Features | Shows |
validation | json | Rejecting a configuration where every field is valid and the whole is not. |
secrets | json | #[config(secret)], and precisely what it does and does not cover. |
testing | json | Pinning configuration under test with the override layer. |
| Example | Features | Shows |
axum_hello | watch, json | A handler that reads current() per request, a /config/check probe, and why the listen port is start-up configuration. |
actix_hello | watch, json | The same across Actix's worker threads, and why configuration does not belong in web::Data. |
| Example | Features | Shows |
tokio_runtime | tokio, watch, json | Two readers each waking on their own changes() handle, with tokio's blocking pool wired in for free. |
smol_runtime | async, watch, json | The whole async surface on smol, with smol's unblock installed as the blocking executor and no tokio in the build. |
embassy_runtime | async, json | Embassy — an executor for microcontrollers, with no threads and no reactor — driving changes(), and why two rapid reloads are one wakeup. |
| Example | Features | Shows |
units | json | "30s" and "64MiB", from files and from the environment. |
generic | json | Db<Postgres> and Db<Mysql> with separate snapshots. |
persistence | json | Writing back atomically, and reading keys with no field. |
remote | json | A RemoteSource of your own: explicit fetch, where it sits between the layers, an unreachable store, and a watch loop pushing through apply_remote. |
last_known_good | json | All three cache_modes against the same broken file, with each cache file printed. |
encrypted | age, json | A secrets.json.age next to a plain config.json: generated key, real ciphertext, and what the wrong key looks like. |
schema | schema, json | A JSON Schema for the file two config types share, with secrets marked and required dropped. |
no_macro | json | load, LoadSpec, Layer and ConfigCell without the attribute. |
cargo run -p dynamic-config --example errors --features json
cargo run -p dynamic-config --example layers --features json
cargo run -p dynamic-config --example cli --features clap,json -- --check
cargo run -p dynamic-config --example hot_reload --features watch,toml
cargo run -p dynamic-config --example remote --features json
cargo run -p dynamic-config --example last_known_good --features json
cargo run -p dynamic-config --example schema --features schema,json
cargo run -p dynamic-config --example encrypted --features age,json
cargo run -p dynamic-config --example axum_hello --features watch,json
cargo run -p dynamic-config --example actix_hello --features watch,json
cargo run -p dynamic-config --example tokio_runtime --features tokio,watch,json
cargo run -p dynamic-config --example smol_runtime --features async,watch,json
cargo run -p dynamic-config --example embassy_runtime --features async,json
APP_ENV=production cargo run -p dynamic-config --example discovery --features json