dynamic-config-tower 0.2.0

A request-scoped dynamic-config snapshot as a plain tower Layer — what dynamic-config-axum is built on
Documentation

dynamic-config-tower

One reading of dynamic-config configuration per request, as a plain tower layer.

[dependencies]
dynamic-config-tower = "0.2.0"
use dynamic_config_tower::{sections, Snapshot, SnapshotLayer};

let layer = SnapshotLayer::new(sections![Server, Features]);
// … any tower stack: tonic, hyper, or a framework of your own.

The service takes one Snapshot when a request begins and puts it in the request's extensions; snapshot.require::<T>() reads it back out with an error that names the fix. dynamic-config-axum is this layer plus an extractor — an axum application should take that crate; this one exists for every tower stack that is not axum.

The layer owns no lifecycle: loading, watching and the WatchHandle stay in your main, unchanged.

See the workspace README for the problem this solves.

MIT licensed.