packages

json::write

JSON text of a Value: compact or indented.

Functions

valueSource

pub fn value(out: StrBuf, v: Value, indent: usize, level: usize)

v into out; indent > 0 puts each member on its own line, indent spaces per level (level is the current one).

stringSource

pub fn string(out: StrBuf, s: str)

s quoted: " \ and control characters escaped, the rest as is.

float_textSource

pub fn float_text(x: f64) -> str

The shortest digits that read back as x, with a .0 or an exponent so it reads back as a float. NaN / infinity have no JSON form: a panic (check is_finite first when the data may hold them).