Skip to main content

chunks_to_value

Function chunks_to_value 

Source
pub async fn chunks_to_value(rx: &mut Receiver<ResponseChunk>) -> Result<Value>
Expand description

Drain a ResponseChunk stream into a single serde_json::Value.

The inverse of value_to_chunks, used by the non-streaming callers (gRPC, jobs, and the backward-compat execute path). The result depends on how the worker finalised the request:

  • ResponseChunk::Return — the value is returned verbatim (gRPC/jobs need their payload intact, not coerced into the HTTP shape);
  • ResponseChunk::Error — propagated as an Err;
  • a Headers/Body stream with no explicit Return is reconstructed into the legacy {status, headers, body} shape for backward compatibility.