Skip to main content

emit_json

Function emit_json 

Source
pub fn emit_json(value: &Value, kind: &str) -> ExitCode
Expand description

Serialize a JSON value to pretty-printed stdout, returning the appropriate exit code.

On success prints the JSON and returns ExitCode::SUCCESS. On serialization failure prints an error to stderr and returns exit code 2.