Lines Matching refs:JsonValue

14 use crate::JsonValue;
38 inner: BTreeMap<String, JsonValue>,
61 /// use ylong_json::{JsonValue, Object};
65 /// object.insert(String::from("null"), JsonValue::Null);
76 /// use ylong_json::{JsonValue, Object};
80 /// object.insert(String::from("null"), JsonValue::Null);
91 /// use ylong_json::{JsonValue, Object, Number};
94 /// object.insert(String::from("null"), JsonValue::Null);
107 /// use ylong_json::{JsonValue, Object};
111 /// object.insert(String::from("null"), JsonValue::Null);
114 pub fn insert(&mut self, key: String, value: JsonValue) {
122 /// use ylong_json::{JsonValue, Object, Number};
125 /// object.insert(String::from("null"), JsonValue::Null);
127 /// assert_eq!(object.remove("null"), Some(JsonValue::Null));
130 pub fn remove(&mut self, key: &str) -> Option<JsonValue> {
143 pub fn iter(&self) -> Iter<'_, String, JsonValue> {
156 pub fn iter_mut(&mut self) -> IterMut<'_, String, JsonValue> {
164 /// use ylong_json::{JsonValue, Object, Number};
167 /// object.insert(String::from("test"), JsonValue::Number(Number::from(123)));
169 /// assert_eq!(object.get("test"), Some(&JsonValue::Number(Number::from(123))));
172 pub fn get(&self, key: &str) -> Option<&JsonValue> {
180 /// use ylong_json::{JsonValue, Object};
183 /// object.insert(String::from("null"), JsonValue::Null);
185 /// assert_eq!(object.get_mut("null"), Some(&mut JsonValue::Null));
188 pub fn get_mut(&mut self, key: &str) -> Option<&mut JsonValue> {
214 use crate::{JsonValue, Object};
231 Some((&String::from("key1"), &mut JsonValue::new_string("value1")))