pub fn add_feature(
config_json: &str,
params: AddFeatureParams<'_>,
) -> Result<String>Expand description
Add a new feature to the configuration
§Arguments
config_json- JSON configuration stringparams- Feature parameters (feature, element_list required; others optional)
§Returns
Modified configuration JSON string
§Example
use sz_configtool_lib::features::{add_feature, AddFeatureParams};
use serde_json::json;
let config = r#"{"G2_CONFIG":{"CFG_FTYPE":[],...}}"#;
let elements = json!([{"element": "NAME"}]);
let result = add_feature(config, AddFeatureParams {
feature: "PERSON",
element_list: &elements,
class: Some("IDENTITY"),
behavior: Some("FM"),
..Default::default()
})?;