gjson.rs
gjson.rs copied to clipboard
Creating new instances of Value
I'd like to create new instances of each type of value. Specifically, I'm using gjson to read settings from a JSON object, but I need a fucntion that produces a default value for the setting for each accessible key. I'd like to be able to do things like this
let str = Value::String("Foobar");
let num = Value::Number(10);
let ok = Value::Bool(true);
let nothing = Value::Null;
Is this possible?