Skip to main content

encode

Function encode 

Source
pub fn encode(value: &Value, to: &str) -> Result<Vec<u8>>
Expand description

Encode a serde_json::Value into bytes of the given format.

ยงExample

let value = serde_json::json!({"hello": "world"});
let yaml = formatforge::encode(&value, "yaml").unwrap();