Skip to main content

try_decode_stream_sync

Function try_decode_stream_sync 

Source
pub fn try_decode_stream_sync(
    lines: impl IntoIterator<Item = String>,
    options: Option<DecodeStreamOptions>,
) -> Result<Vec<JsonStreamEvent>>
Expand description

Try to decode TOON lines into a stream of events, returning a Result.

This is the fallible version of decode_stream_sync. Use this when you want to handle decoding errors gracefully instead of panicking.

ยงErrors

Returns an error if decoding fails due to malformed input or strict-mode validation errors.