apply_yaml_patches

Function apply_yaml_patches 

Source
pub fn apply_yaml_patches(
    document: &Document,
    patches: &[Patch<'_>],
) -> Result<Document, Error>
Expand description

Apply a sequence of YAML patch operations to a YAML document. Returns a new YAML document with the patches applied.

Returns an error if the given YAML input is not valid, if a patch operation fails, or if the resulting YAML is malformed.

Each patch is applied in the order given. The Patch APIs are designed to operate symbolically without absolute byte positions, so operations should not invalidate each other unless they actually conflict in terms of proposed changes.