Lines Matching refs:Object

22 pub use object::Object;
54 /// 6.Object: Object type
81 /// Object type
82 Object(Object),
104 Self::Object(o) => Display::fmt(o, f),
192 /// Creates an instance of JsonValue for Object type.
196 /// use ylong_json::{JsonValue, Object};
198 /// let value = JsonValue::new_object(Object::new());
199 /// assert_eq!(value, JsonValue::Object(Object::new()));
201 pub fn new_object(object: Object) -> Self {
202 Self::Object(object)
323 /// Determines whether JsonValue is Object type. Returns true if yes, false if no.
327 /// use ylong_json::{JsonValue, Object};
329 /// let object_value = JsonValue::new_object(Object::new());
336 matches!(*self, Self::Object(_))
422 /// Trys to convert JsonValue to a common reference of Object type. Conversion failure will return Error.
426 /// use ylong_json::{JsonValue, Object, Error};
428 /// let array_value = JsonValue::new_object(Object::new());
429 /// assert_eq!(array_value.try_as_object().unwrap(), &Object::new());
434 pub fn try_as_object(&self) -> Result<&Object, Error> {
436 Self::Object(object) => Ok(object),
524 /// Trys to convert JsonValue to a mutable reference of Object type. Conversion failure will return Error.
528 /// use ylong_json::{JsonValue, Error, Object};
530 /// let mut object_value = JsonValue::new_object(Object::new());
531 /// assert_eq!(object_value.try_as_mut_object().unwrap(), &mut Object::new());
536 pub fn try_as_mut_object(&mut self) -> Result<&mut Object, Error> {
538 Self::Object(object) => Ok(object),
632 /// Trys to convert JsonValue to Object type. This method transfers ownership.
637 /// use ylong_json::{JsonValue, Error, Object};
639 /// let object_value = JsonValue::new_object(Object::new());
640 /// assert_eq!(object_value.try_into_object().unwrap(), Object::new());
645 pub fn try_into_object(self) -> Result<Object, Error> {
647 Self::Object(object) => Ok(object),
652 /// Trys to remove a member form an Object or Array. If the member is found by Index,
653 /// gets value of the member from the Object or Array.
657 /// use ylong_json::{Object, JsonValue};
659 /// let mut object = Object::new();
835 /// use ylong_json::{JsonValue, Array, Object};
842 /// assert_eq!(JsonValue::new_object(Object::new()), JsonValue::new_object(Object::new()));
854 /// let mut object1 = Object::new();
857 /// let mut object2 = Object::new();
868 (JsonValue::Object(a), JsonValue::Object(b)) => a == b,
993 json_value_from_type!(Object, JsonValue::new_object);
999 use super::{array::Array, object::Object, JsonValue};
1072 assert!(!JsonValue::new_object(Object::new()).is_null());
1092 assert!(!JsonValue::new_object(Object::new()).is_true());
1112 assert!(!JsonValue::new_object(Object::new()).is_false());
1132 assert!(!JsonValue::new_object(Object::new()).is_boolean());
1152 assert!(!JsonValue::new_object(Object::new()).is_number());
1172 assert!(!JsonValue::new_object(Object::new()).is_string());
1192 assert!(!JsonValue::new_object(Object::new()).is_array());
1212 assert!(JsonValue::new_object(Object::new()).is_object());
1234 assert!(JsonValue::new_object(Object::new())
1256 assert!(JsonValue::new_object(Object::new())
1278 assert!(JsonValue::new_object(Object::new())
1300 assert!(JsonValue::new_object(Object::new()).try_as_array().is_err());
1320 assert!(JsonValue::new_object(Object::new()).try_as_object().is_ok());
1344 assert!(JsonValue::new_object(Object::new())
1370 assert!(JsonValue::new_object(Object::new())
1396 assert!(JsonValue::new_object(Object::new())
1422 assert!(JsonValue::new_object(Object::new())
1448 assert!(JsonValue::new_object(Object::new())
1474 assert!(JsonValue::new_object(Object::new())
1500 assert!(JsonValue::new_object(Object::new())
1526 assert!(JsonValue::new_object(Object::new())
1550 assert!(JsonValue::new_object(Object::new())
1576 assert!(JsonValue::new_object(Object::new())
1651 JsonValue::new_object(Object::new()),
1652 JsonValue::new_object(Object::new())
1674 JsonValue::from(Object::new()),
1675 JsonValue::new_object(Object::new())
1685 JsonValue::from(&Object::new()),
1686 JsonValue::new_object(Object::new())
1696 JsonValue::from(&mut Object::new()),
1697 JsonValue::new_object(Object::new())