Function snitch_transform::transform::overwrite
source · pub fn overwrite(req: &TransformRequest) -> Result<String, TransformError>Examples found in repository?
examples/usage.rs (line 23)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
fn overwrite() {
let sample_json = r#"{"hello": "world"}"#;
let mut req = protos::transform::TransformRequest::new();
req.data = sample_json.into();
req.path = "hello".to_string();
req.value = r#""baz""#.to_string();
let updated_json = snitch_transform::transform::overwrite(&req).unwrap();
println!(
"Input JSON: {} || Result JSON: {}",
sample_json, updated_json,
)
}