Skip to main content

apply_set

Function apply_set 

Source
pub fn apply_set(
    value: &Value,
    segments: &[Segment],
    new_value: &Value,
) -> Result<Value, PickError>
Expand description

Set a value at the given path, returning a new Value with the modification. Creates intermediate objects/arrays as needed.

Time: O(d * w) where d = path depth, w = width at each level (clone cost). Space: O(N) for the cloned tree.