Function create_or_merge

Source
pub fn create_or_merge(source: Source, attrs: Attrs)
Expand description

Insert or update a configuration layer for the given Source.

If a layer with the same Source already exists, its attributes are updated in place: all keys present in attrs are absorbed into the existing layer, overwriting any previous values for those keys while leaving all other keys in that layer unchanged.

If no layer for source exists yet, this behaves like set: a new layer is created with the provided attrs.

This is useful for incremental / additive updates (for example, runtime configuration driven by a Python API), where callers want to change a subset of keys without discarding previously installed values in the same layer.

By contrast, set replaces the entire layer for source with attrs, discarding any existing values in that layer.