Expand description
§use-config-key
Primitive configuration key, path, and section types.
use-config-key models names for configuration values. It supports plain keys such as port and dotted paths such as server.port, while rejecting empty keys and empty path segments.
use use_config_key::ConfigPath;
let path = ConfigPath::parse("server.port").unwrap();
let segments: Vec<_> = path.segments().collect();
assert_eq!(segments, vec!["server", "port"]);
assert_eq!(path.to_string(), "server.port");This crate only models names. It does not read files, parse configuration formats, or resolve values.
Structs§
- Config
Key - A validated single configuration key segment.
- Config
Path - A validated dotted configuration path.
- Config
Section - A validated configuration section name.
Enums§
- Config
KeyError - Error returned when a configuration key, section, or path is invalid.