Skip to main content

json_to_exact_value

Function json_to_exact_value 

Source
pub fn json_to_exact_value(v: Value) -> Result<Option<Value>, String>
Expand description

A JSON value as a stored Value, keeping a float a float.

mushroomdb::json_to_value reads an integral number such as 3.0 as an integer, which is right for hand-written JSON and wrong for the file an export wrote: Float(3.0) must come back as a float. A JSON number with a fraction or exponent is a float here, one without is an integer. A one-key object whose key is a type tag is the typed value, read by the engine’s own reader; null is an absent value, and inside a list it drops the whole list, as in json_to_value.