Skip to main content

Module setter

Module setter 

Source
Expand description

Generic config setter that works for ALL schema-known keys.

Instead of a hardcoded match arm per key, this module:

  1. Validates the key against ConfigSchema
  2. Parses the value according to the schema type
  3. Performs a TOML round-trip to set the value
  4. Deserializes back into Config for full serde validation

Functionsยง

current_value
Returns the current value of key from the on-disk config.toml, rendered as the string a user would type (no TOML quoting), or None if the key is unset (still at its schema default).
set_by_key
Attempts to set a config key generically via schema-validated TOML round-trip.