Skip to main content

render_json

Function render_json 

Source
pub fn render_json<R: Serialize>(rows: &[R]) -> Result<String, RenderError>
Expand description

Render rows as a pretty-printed JSON array (one element per row, two-space indent, trailing newline).

§Errors

RenderError::Json when any row fails to serialise — typical causes are non-string Map keys or non-finite floats. Always programmer mistake; payload is a stringified serde_json::Error.