Skip to main content

decode_json

Function decode_json 

Source
pub fn decode_json<T: DeserializeOwned>(bytes: &[u8]) -> Result<T>
Expand description

Decode JSON without silently rounding integer tokens outside i64/u64.

Use this at transport boundaries before constructing portable contract types. Fractions and exponent-form numbers use finite binary64, as in the Python helper; encode arbitrary-precision decimals or larger integers as strings. JSON syntax, nesting and the target schema are still checked by serde_json.