pub fn write_json_line<T>(writer: &mut impl Write, val: &T) -> Result<(), Error>where T: Serialize,
Serialize val as a single JSON line and flush the writer (sync).
val