Lines Matching refs:JsonValue

14 use crate::JsonValue;
45 inner: Vec<(String, JsonValue)>,
66 /// use ylong_json::{JsonValue, Object};
70 /// object.insert(String::from("null"), JsonValue::Null);
81 /// use ylong_json::{JsonValue, Object};
85 /// object.insert(String::from("null"), JsonValue::Null);
96 /// use ylong_json::{JsonValue, Object, Number};
99 /// object.insert(String::from("null"), JsonValue::Null);
112 /// use ylong_json::{JsonValue, Object};
116 /// object.insert(String::from("null"), JsonValue::Null);
119 pub fn insert(&mut self, key: String, value: JsonValue) {
128 /// use ylong_json::{JsonValue, Object, Number};
131 /// object.insert(String::from("null"), JsonValue::Null);
133 /// assert_eq!(object.remove("null"), Some(JsonValue::Null));
136 pub fn remove(&mut self, key: &str) -> Option<JsonValue> {
150 pub fn iter(&self) -> Iter<'_, (String, JsonValue)> {
163 pub fn iter_mut(&mut self) -> IterMut<'_, (String, JsonValue)> {
172 /// use ylong_json::{JsonValue, Object, Number};
175 /// object.insert(String::from("test"), JsonValue::Number(Number::from(123)));
177 /// assert_eq!(object.get("test"), Some(&JsonValue::Number(Number::from(123))));
180 pub fn get(&self, key: &str) -> Option<&JsonValue> {
189 /// use ylong_json::{JsonValue, Object};
192 /// object.insert(String::from("null"), JsonValue::Null);
194 /// assert_eq!(object.get_mut("null"), Some(&mut JsonValue::Null));
197 pub fn get_mut(&mut self, key: &str) -> Option<&mut JsonValue> {
205 pub(crate) fn last_mut(&mut self) -> Option<&mut JsonValue> {
209 pub(crate) fn get_mut_by_position(&mut self, index: usize) -> Option<&mut JsonValue> {
222 /// use ylong_json::{Object, JsonValue};
227 /// object3.insert("test".to_string(), JsonValue::Null);
266 use crate::{JsonValue, Object};
299 Some(&mut (String::from("key1"), JsonValue::new_string("value1")))
318 Some(&mut JsonValue::new_string("value1"))