Lines Matching refs:try_as_object
429 /// assert_eq!(array_value.try_as_object().unwrap(), &Object::new());
432 /// assert!(other_value.try_as_object().is_err());
434 pub fn try_as_object(&self) -> Result<&Object, Error> {
1303 /// UT test for `JsonValue::try_as_object`.
1310 /// 2. Calls `JsonValue::try_as_object`.
1314 assert!(JsonValue::new_null().try_as_object().is_err());
1315 assert!(JsonValue::new_boolean(true).try_as_object().is_err());
1316 assert!(JsonValue::new_boolean(false).try_as_object().is_err());
1317 assert!(JsonValue::new_number(12.34.into()).try_as_object().is_err());
1318 assert!(JsonValue::new_string("hello").try_as_object().is_err());
1319 assert!(JsonValue::new_array(Array::new()).try_as_object().is_err());
1320 assert!(JsonValue::new_object(Object::new()).try_as_object().is_ok());