Function openrr_config::overwrite

source ·
pub fn overwrite(doc: &mut Value, scripts: &str) -> Result<()>
Expand description

Replaces the contents of the specified TOML document based on the specified scripts.

You can specify multiple scripts at once (newline-separated or semicolon-separated). Empty scripts, and leading and trailing separators will be ignored.

§Set operation

Syntax:

<key> = <value>
  • If the specified key or array index exists, replace its value.
  • If the specified key does not exist, create the specified key and value.
  • If the specified array index does not exist, append the specified value to the array.
  • If the intermediate data structures do not exist, create them.

§Delete operation

Syntax:

<key> =
  • Deletes the specified key and its value or specified array element.
  • If the specified key or array index does not exist, it will be ignored.