Skip to main content

path_set

Function path_set 

Source
pub fn path_set(target: &mut Value, path: &str, new_value: Value)
Expand description

Write new_value at path inside target. Intermediate objects are created as needed; arrays are extended with Value::Null up to the target index. Numeric segments map to array indices only when the current node is already an array.

An empty path is a no-op (the caller should replace target directly if they want to overwrite the root).