to_writer

Function to_writer 

Source
pub fn to_writer<T, W: Write>(value: &Value<T>, writer: W) -> Result
Expand 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" }"#)