Expand description
Reflectable configuration registry.
Modules that read config via [Config::unmarshal_key_registered] are
automatically recorded in a global registry. This enables:
- Listing all config sections an application uses
- Dumping the effective config (with redaction) for debugging
- Dumping defaults for documentation
- Future: admin
/configendpoint, change notifications
§Auto-registration
use hyperi_rustlib::config;
// This automatically registers "expression" in the registry:
let cfg = config::get();
let profile: MyConfig = cfg.unmarshal_key_registered("expression").unwrap_or_default();
// Later, reflect on all registered sections:
for section in config::registry::sections() {
println!("{}: {}", section.key, section.type_name);
}Structs§
- Config
Section - A registered config section.
Functions§
- dump_
defaults - Dump all default config values as a JSON object (redacted).
- dump_
effective - Dump all effective config values as a JSON object (redacted).
- dump_
effective_ unredacted - Dump effective config WITHOUT redaction (for internal/debug use only).
- get_
section - Get a single registered section by key.
- is_
registered - Check if a specific key is registered.
- on_
change - Subscribe to changes for a specific config key (opt-in).
- register
- Register a config section in the global registry.
- sections
- List all registered config sections, sorted by key.
- update
- Re-register a config section and notify listeners.