1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
b0VIM 7.4 ��U��� erickt Erick-Tryzelaar-MBP.local ~erickt/projects/rust/serde/serde/serde_json/src/value.rs utf-8
3210 #"! U tp v ��������{ w ��������w � ��������� i ��������y � �������� l ��������� � K m @ o ad , v � � � � � � � � y i h V U 9 ( � � � � � � � � +
�
�
�
k
a
[
Z
� � 9 � � � } s ^ X W 5 - �
�
�
�
~
6
.
� � � � \ 7 � � � � � � j � � � c > � � � C � � � � � � y o i h � � � � � ` � � � � � � X 8 � � � { q k j /// Returns true if the `Value` is an Array. Returns false otherwise. } } _ => None &mut Value::Object(ref mut map) => Some(map), match self { pub fn as_object_mut<'a>(&'a mut self) -> Option<&'a mut BTreeMap<String, Value>> { /// Returns None otherwise. /// If the `Value` is an Object, returns the associated mutable BTreeMap. } } _ => None &Value::Object(ref map) => Some(map), match self { pub fn as_object<'a>(&'a self) -> Option<&'a BTreeMap<String, Value>> { /// Returns None otherwise. /// If the `Value` is an Object, returns the associated BTreeMap. } self.as_object().is_some() pub fn is_object<'a>(&'a self) -> bool { /// Returns true if the `Value` is an Object. Returns false otherwise. } } _ => None }, } } None } } _ => () x if x.is_some() => return x, match v.search(key) { for (_, v) in map.iter() { None => { Some(json_value) => Some(json_value), match map.get(key) { &Value::Object(ref map) => { match self { pub fn search<'a>(&'a self, key: &str) -> Option<&'a Value> { /// or the `Value` is not an Object, returns None. /// a value associated with the provided key is found. If no value is found /// If the `Value` is an Object, performs a depth-first search until } Some(target) } } None => return None Some(t) => { target = t; }, match target.find(key) { for key in path.split('.') { let mut target = self; pub fn lookup<'a>(&'a self, path: &str) -> Option<&'a Value> { /// ``` /// assert!(obj.lookup("x.a").unwrap() == &Value::U64(1)); ///