[go: up one dir, main page]

sval_json 2.3.0

JSON support for sval
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::Error;

use alloc::string::String;

/**
Stream a value as JSON into a string.

This method will fail if the value contains complex values as keys.
*/
pub fn stream_to_string(v: impl sval::Value) -> Result<String, Error> {
    let mut out = String::new();
    crate::stream_to_fmt_write(&mut out, v)?;

    Ok(out)
}