Skip to main content

decode_dispatch

Function decode_dispatch 

Source
pub fn decode_dispatch(line: &str, line_number: u64) -> DecodedLine
Expand description

Decode one stream-json line, dispatching on the type field.

Returns one of DecodedLine’s variants and never fails. For forward-compat with future claude CLI releases, any top-level type value forge-sdk doesn’t recognise lands in DecodedLine::Unknown, and a line that cannot be decoded at all lands in DecodedLine::Malformed - callers (notably the wire-conformance harness) can detect both by matching the variant. The read loop in the events stream returned by Client::spawn warns on either and continues reading.