Skip to main content

write_json

Function write_json 

Source
pub fn write_json<T: Serialize + ?Sized>(
    value: &T,
    f: &mut Formatter<'_>,
) -> Result
Expand description

Writes value to f as compact JSON.

When value cannot be serialized, writes Error serializing to JSON: <reason> instead.

ยงErrors

Returns fmt::Error only when the formatter itself fails to write.