Skip to main content

Module hot_config

Module hot_config 

Source
Expand description

§Hot-Reloadable Configuration

Polls a TOML-like flat key=value configuration file at a configurable interval and broadcasts a new version number to all subscribers whenever the file changes (detected via mtime).

§Supported syntax

The parser handles:

§Example

use tokio_prompt_orchestrator::hot_config::{HotConfig, ConfigValue};

let cfg = HotConfig::from_defaults();
cfg.set("workers", ConfigValue::Int(4));
assert_eq!(cfg.get("workers"), Some(ConfigValue::Int(4)));

Structs§

ConfigSnapshot
An immutable snapshot of the configuration at a point in time.
HotConfig
Hot-reloadable configuration object.

Enums§

ConfigError
Errors that can occur during configuration loading or parsing.
ConfigValue
A typed configuration value.

Traits§

FromConfigValue
Fallible conversion from a ConfigValue reference to a concrete type.

Functions§

load_toml
Parse a flat TOML-like key=value file into a ConfigSnapshot.