pub async fn execute_to_completion(
stream: ToolOutputStream,
on_preliminary: impl FnMut(JsonValue),
) -> Result<JsonValue, ToolError>Expand description
Drives an output stream to its end, forwarding preliminary values to
on_preliminary and returning the final value.
ยงErrors
Returns the first error produced by the stream, or a
ToolError::Message when the stream ends without a final output.