Function scale_value::stringify::to_writer
source · pub fn to_writer<T, W: Write>(value: &Value<T>, writer: W) -> ResultExpand description
Format a crate::Value to a string, writing it to the provided writer.
§Example
use scale_value::{Value, value};
let value = value!({
foo: true,
bar: "hello"
});
// Write the ourput to a string or any other writer.
let mut s = String::new();
scale_value::stringify::to_writer(&value, &mut s).unwrap();
assert_eq!(s, r#"{ foo: true, bar: "hello" }"#)