Type Alias json_with_comments::Value

source ·
pub type Value = JsoncValue<i64, f64>;
Expand description

Aliased Type§

enum Value {
    Object(HashMap<String, JsoncValue<i64, f64>>),
    Array(Vec<JsoncValue<i64, f64>>),
    Bool(bool),
    Null,
    String(String),
    Number(Number<i64, f64>),
}

Variants§

§

Object(HashMap<String, JsoncValue<i64, f64>>)

Represents any valid JSON with comments object. Default implementation is HashMap. If preserve_order feature is enabled, that will be IndexMap.

let v = json_with_comments::jsonc!({"key": "value"});
§

Array(Vec<JsoncValue<i64, f64>>)

Represents any valid JSON with comments array.

let v = json_with_comments::jsonc!([1, 2, 3]);
§

Bool(bool)

Represents any valid JSON with comments boolean.

let v = json_with_comments::jsonc!(true);
§

Null

Represents any valid JSON with comments null.

let v = json_with_comments::jsonc!(null);
§

String(String)

Represents any valid JSON with comments string.

let v = json_with_comments::jsonc!("string");
§

Number(Number<i64, f64>)

Represents any valid JSON with comments number, whether integer or float.

let v = json_with_comments::jsonc!(123.45);