jsonic/
json_type.rs

1/// An enum representing JSON types
2/// * `JsonNull` → null
3/// * `JsonTrue`, `JsonFalse` → true, false
4/// * `JsonString` → a string
5/// * `JsonNumber` → an integer or float
6/// * `JsonMap` → a JSON object
7/// * `JsonArray` → a JSON array
8/// * `Empty` → Element not found. See code below.
9///
10/// ```rust
11/// use jsonic::json_item::JsonItem;
12/// use jsonic::json_type::JsonType::Empty;
13///
14/// let json = "{\"a\":\"b\"}";
15///
16/// if let Ok(parsed) = jsonic::parse(json) {
17///     assert_eq!(parsed["c"].get_type(), &Empty);
18/// }
19#[derive(PartialEq, Debug)]
20pub enum JsonType {
21    JsonNull,
22    JsonTrue,
23    JsonFalse,
24    JsonString,
25    JsonNumber,
26    JsonMap,
27    JsonArray,
28    Empty,
29}