Skip to main content

parse_streaming_json

Function parse_streaming_json 

Source
pub fn parse_streaming_json<T: DeserializeOwned + Default>(json: &str) -> T
Expand description

Attempts to parse potentially incomplete JSON from a streaming response.

Tries multiple strategies:

  1. Direct parse
  2. Parse with repair
  3. Truncate at last valid position and retry

Always returns a valid value, using default as fallback.