simdjson_rust/ondemand/
json_type.rs1#[derive(Debug, PartialEq)]
2pub enum JsonType {
3 Array = 1,
4 Object,
5 Number,
6 String,
7 Boolean,
8 Null,
9}
10
11impl From<i32> for JsonType {
12 fn from(value: i32) -> Self {
13 match value {
14 1 => JsonType::Array,
15 2 => JsonType::Object,
16 3 => JsonType::Number,
17 4 => JsonType::String,
18 5 => JsonType::Boolean,
19 6 => JsonType::Null,
20 _ => panic!("Invalid JsonType value: {}", value),
21 }
22 }
23}
24
25#[derive(Debug, PartialEq)]
26pub enum NumberType {
27 FloatingPointNumber = 1,
28 SignedInteger,
29 UnsignedInteger,
30}
31
32impl From<i32> for NumberType {
33 fn from(value: i32) -> Self {
34 match value {
35 1 => NumberType::FloatingPointNumber,
36 2 => NumberType::SignedInteger,
37 3 => NumberType::UnsignedInteger,
38 _ => panic!("Invalid NumberType value: {}", value),
39 }
40 }
41}