Skip to main content

render_json

Function render_json 

Source
pub fn render_json(results: &DecodeResults<'_>) -> Result<String, Error>
Expand description

Render the decode as a JSON object keyed by section. Each value is the serde-serialized library type; a failed section carries an error indicator, so the object always has all five keys and stays valid JSON.

ยงErrors

Returns a serde_json::Error only if serializing a decoded value fails, which the decoded types do not do in practice.