Skip to main content

try_decode

Function try_decode 

Source
pub fn try_decode(
    input: &str,
    options: Option<DecodeOptions>,
) -> Result<JsonValue>
Expand description

Try to decode a TOON string into a JSON value, returning a Result.

This is the fallible version of decode. 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.