Home
last modified time | relevance | path

Searched refs:from_str (Results 1 - 17 of 17) sorted by relevance

/commonlibrary/rust/ylong_json/benches/
H A Dserialize_json_cmp.rs32 let value = JsonValue::from_str(NULL_EXAMPLE).unwrap(); in null_serialize_perf_ylong_json()
42 let value = JsonValue::from_str(BOOLEAN_EXAMPLE).unwrap(); in boolean_serialize_perf_ylong_json()
52 let value = JsonValue::from_str(NUMBER_EXAMPLE).unwrap(); in number_serialize_perf_ylong_json()
62 let value = JsonValue::from_str(STRING_EXAMPLE).unwrap(); in string_serialize_perf_ylong_json()
72 let value = JsonValue::from_str(ARRAY_EXAMPLE).unwrap(); in array_serialize_perf_ylong_json()
82 let value = JsonValue::from_str(OBJECT_EXAMPLE).unwrap(); in object_serialize_perf_ylong_json()
92 let value = JsonValue::from_str(RFC7159_EXAMPLE1).unwrap(); in exp1_serialize_perf_ylong_json()
102 let value = JsonValue::from_str(RFC7159_EXAMPLE2).unwrap(); in exp2_serialize_perf_ylong_json()
112 let value = JsonValue::from_str(JSON_PARSE_TEST).unwrap(); in exp3_serialize_perf_ylong_json()
122 let value = JsonValue::from_str(LONG_KEY_VALU in exp4_serialize_perf_ylong_json()
[all...]
H A Ddeserialize_json_cmp.rs34 let _value = JsonValue::from_str(NULL_EXAMPLE).unwrap(); in null_deserialize_perf_ylong_json()
43 let _value = JsonValue::from_str(BOOLEAN_EXAMPLE).unwrap(); in boolean_deserialize_perf_ylong_json()
52 let _value = JsonValue::from_str(NUMBER_EXAMPLE).unwrap(); in number_deserialize_perf_ylong_json()
61 let _value = JsonValue::from_str(STRING_EXAMPLE).unwrap(); in string_deserialize_perf_ylong_json()
70 let _value = JsonValue::from_str(ARRAY_EXAMPLE).unwrap(); in array_deserialize_perf_ylong_json()
79 let _value = JsonValue::from_str(OBJECT_EXAMPLE).unwrap(); in object_deserialize_perf_ylong_json()
88 let _value = JsonValue::from_str(RFC7159_EXAMPLE1).unwrap(); in exp1_deserialize_perf_ylong_json()
97 let _value = JsonValue::from_str(RFC7159_EXAMPLE2).unwrap(); in exp2_deserialize_perf_ylong_json()
106 let _value = JsonValue::from_str(JSON_PARSE_TEST).unwrap(); in exp3_deserialize_perf_ylong_json()
115 let _value = JsonValue::from_str(LONG_KEY_VALU in exp4_deserialize_perf_ylong_json()
[all...]
/commonlibrary/rust/ylong_http/ylong_http_client/src/
H A Derror.rs158 pub(crate) fn from_str(kind: ErrorKind, msg: &'static str) -> Self {
331 Err(HttpClientError::from_str(ErrorKind::$kind, $msg))
397 HttpClientError::from_str(ErrorKind::Request, "test error"), in ut_err_from_error()
402 /// UT test cases for `HttpClientError::from_str` function.
405 /// 1. Calls `HttpClientError::from_str`.
409 let error_request = HttpClientError::from_str(ErrorKind::Request, "error"); in ut_err_from_str()
411 let error_timeout = HttpClientError::from_str(ErrorKind::Timeout, "error"); in ut_err_from_str()
431 let error = HttpClientError::from_str(ErrorKind::Request, "error"); in ut_client_err_io_error()
/commonlibrary/rust/ylong_http/ylong_http_client/src/sync_impl/
H A Dhttp_body.rs113 HttpClientError::from_str(ErrorKind::BodyDecode, "Get trailer failed") in trailer()
142 return Err(HttpClientError::from_str(ErrorKind::BodyDecode, "Not Eof")); in data()
159 return Err(HttpClientError::from_str( in data()
171 return Err(HttpClientError::from_str( in data()
240 return Err(HttpClientError::from_str( in data()
302 return Err(HttpClientError::from_str( in merge_chunks()
/commonlibrary/rust/ylong_json/src/
H A Ddeserializer.rs156 /// use ylong_json::from_str;
171 /// assert_eq!(expected, from_str(str).unwrap())
173 pub fn from_str<'a, T>(str: &'a str) -> Result<T, Error> in from_str() functions
847 use crate::deserializer::{from_slice, from_str};
1038 /// 1.Uses deserializer::from_str method to deserialize struct.
1046 assert_eq!(expected, from_str(str).unwrap()); in ut_deserialize_struct()
1052 assert_eq!(expected, from_str(str).unwrap()); in ut_deserialize_struct()
1058 assert_eq!(expected, from_str(str).unwrap()); in ut_deserialize_struct()
1073 assert_eq!(expected, from_str(str).unwrap()); in ut_deserialize_struct()
1085 assert_eq!(expected, from_str(st
[all...]
H A Dlib.rs83 pub use deserializer::{from_reader, from_slice, from_str};
H A Dvalue.rs814 /// let value = JsonValue::from_str(text).unwrap();
818 fn from_str(s: &str) -> Result<Self, Self::Err> { in from_str() functions
1612 /// UT test for `JsonValue::from_str`.
1618 /// 1. Calls `JsonValue::from_str` to create a `JsonValue`.
1622 assert_eq!(JsonValue::from_str("null").unwrap(), JsonValue::new_null()); in ut_json_value_from_str()
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/
H A Dalt_svc.rs66 Port::from_str(str::from_utf8(&host_port[1..]).ok()?).ok()?, in parse_alt_svc()
70 Some(Host::from_str(str::from_utf8(&host_port[..index]).ok()?).ok()?), in parse_alt_svc()
71 Port::from_str(str::from_utf8(&host_port[(index + 1)..]).ok()?).ok()?, in parse_alt_svc()
H A Dredirect.rs69 .ok_or(HttpClientError::from_str(
129 .ok_or(HttpClientError::from_str( in trigger()
H A Dproxy.rs91 self.no_proxy = NoProxy::from_str(no_proxy);
194 pub(crate) fn from_str(no_proxy: &str) -> Option<Self> {
H A Ddispatcher.rs440 HttpClientError::from_str(ErrorKind::Request, "Request Sender Closed !")
579 None => Err(HttpClientError::from_str(
662 HttpClientError::from_str(Request, "Coroutine channel closed.")
665 HttpClientError::from_str(Request, "remote peer closed.")
812 HttpClientError::from_str(ErrorKind::Request, "Request Sender Closed !")
899 HttpClientError::from_str(Request, "Coroutine channel closed.")
903 HttpClientError::from_str(Request, "received remote goaway.")
906 HttpClientError::from_str(Request, "stream finished.")
909 HttpClientError::from_str(Request, "remote peer closed.")
H A Dnormalizer.rs34 return Err(HttpClientError::from_str(
109 .map_err(|_| HttpClientError::from_str(ErrorKind::Request, "Normalize url failed"))?;
/commonlibrary/rust/ylong_json/tests/
H A Dsdv_adapt_serde_test.rs16 use ylong_json::from_str;
69 let de_res = from_str::<ExampleOne>(RFC7159_EXAMPLE1); in sdv_adapt_serde_example_one()
133 let de_res = from_str::<Vec<ExampleTwo>>(RFC7159_EXAMPLE2).unwrap(); in sdv_adapt_serde_example_two()
364 let de_res = from_str::<ParseTest>(JSON_PARSE_EXAMPLE3); in sdv_adapt_serde_example_three()
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/connector/
H A Dmod.rs319 Err(last_e.unwrap_or(HttpClientError::from_str( in connect()
557 vec![SocketAddr::from_str(handle.addr.as_str()).unwrap()], in ut_ssl_tunnel_error()
595 vec![SocketAddr::from_str(handle.addr.as_str()).unwrap()], in ut_ssl_tunnel_error()
635 vec![SocketAddr::from_str(handle.addr.as_str()).unwrap()], in ut_ssl_tunnel_error()
682 vec![SocketAddr::from_str(handle.addr.as_str()).unwrap()], in ut_ssl_tunnel_connect()
729 vec![SocketAddr::from_str(handle.addr.as_str()).unwrap()], in ut_ssl_tunnel_resp_beyond_size()
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/conn/
H A Dhttp3.rs118 return Err(HttpClientError::from_str( in frame_2_response()
134 return Err(HttpClientError::from_str(ErrorKind::Request, "bad frame")); in frame_2_response()
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/quic/
H A Dmod.rs72 .map_err(|_| HttpClientError::from_str(ErrorKind::Connect, "Quic init error"))?;
114 Err(HttpClientError::from_str(
152 e = Err(HttpClientError::from_str(
/commonlibrary/rust/ylong_http/ylong_http/src/request/uri/
H A Dmod.rs790 /// let host = Host::from_str("www.example.com").unwrap();
793 fn from_str(host: &str) -> Result<Self, Self::Err> { in from_str() functions
860 /// let host = Port::from_str("80").unwrap();
863 fn from_str(port: &str) -> Result<Self, Self::Err> { in from_str() functions

Completed in 12 milliseconds