Skip to main content

recover_request_id

Function recover_request_id 

Source
fn recover_request_id(line: &str) -> NumberOrString
Expand description

Best-effort recovery of the id field from a malformed JSON-RPC payload. Falls back to Number(0) when extraction fails (the JSON-RPC spec says “null” is the canonical placeholder, but rmcp’s RequestId doesn’t admit a null variant — Number(0) is the closest match and round-trips cleanly).