sval_fmt 2.18.0

Integration between std::fmt::Debug and sval::Value
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use alloc::string::String;

/**
Format a value into a string.

This method will use a default format that's like Rust's `Debug`.
*/
pub fn stream_to_string(v: impl sval::Value) -> String {
    let mut out = String::new();
    crate::stream_to_write(&mut out, v).expect("infallible write");
    out
}