analyse_json/
json.rs

1// Re-exports
2pub use indexmap::IndexMap;
3pub use serde_json;
4pub use serde_json::Value;
5
6pub mod ndjson;
7pub mod paths;
8
9/// Defines string representations of the serde JSON [`Value`] types
10trait ValueType {
11    fn value_type(&self) -> String;
12}
13
14impl ValueType for Value {
15    fn value_type(&self) -> String {
16        match self {
17            Value::Object(_) => "Object".to_string(),
18            Value::Null => "Null".to_string(),
19            Value::Bool(_) => "Bool".to_string(),
20            Value::Number(_) => "Number".to_string(),
21            Value::String(_) => "String".to_string(),
22            Value::Array(_) => "Array".to_string(),
23        }
24    }
25}