Skip to main content

delete_from_config_array

Function delete_from_config_array 

Source
pub fn delete_from_config_array(
    config_json: &str,
    section: &str,
    field: &str,
    value: &str,
) -> Result<String>
Expand description

Delete item from config array by field value

§Arguments

  • config_json - JSON configuration string
  • section - Section name (e.g., “CFG_DSRC”, “CFG_ATTR”)
  • field - Field name to match (e.g., “DSRC_CODE”, “ATTR_CODE”)
  • value - Value to match for deletion

§Returns

Modified configuration JSON string

§Errors

  • JsonParse if config_json is invalid
  • MissingSection if section doesn’t exist
  • NotFound if no item matches the criteria