Skip to main content

write_json_stdout

Function write_json_stdout 

Source
pub fn write_json_stdout<T>(out: &T) -> Result<(), Error>
where T: Serialize,
Expand description

Write a single JSON value plus trailing newline to stdout.

Treats a closed downstream pipe as a successful early stop. CLI tools should be composable with head, true, and other short readers; a consumer choosing to close stdout is not a Heddle failure.