(json_str: &str)
| 2 | use serde_json::Value; |
| 3 | |
| 4 | pub fn parse(json_str: &str) -> Result<Variant, serde_json::Error> { |
| 5 | let value: Value = serde_json::from_str(json_str)?; |
| 6 | Ok(Variant::from_json_value(value)) |
| 7 | } |
| 8 | |
| 9 | pub fn stringify(value: &Variant) -> Result<String, serde_json::Error> { |
| 10 | let json_value = value.to_json_value(); |
no outgoing calls