merge_config

Function merge_config 

Source
pub fn merge_config<C: Serialize + DeserializeOwned + Clone>(
    base: &C,
    partial: &str,
    partial_path: impl IntoIterator<Item = &str>,
) -> Result<Option<C>, ConfigMergeError>
Expand description

Extract the section at partial_path from partial, merge it into base to override entries.

Tables will be merged recursively, while other fields (including arrays) will be replaced by the partial config, if exists.

Returns an error if any of the input is invalid, or the merged config cannot be parsed. Returns None if there’s nothing to override.