Home
last modified time | relevance | path

Searched refs:try_from (Results 1 - 16 of 16) sorted by relevance

/commonlibrary/rust/ylong_http/ylong_http/tests/
H A Dsdv_http_version.rs21 /// 1. Creates a Version by build try_from.
31 assert_eq!(Version::try_from("HTTP/1.0").unwrap(), Version::HTTP1_0); in sdv_client_send_request_repeatedly()
32 assert_eq!(Version::try_from("HTTP/1.1").unwrap(), Version::HTTP1_1); in sdv_client_send_request_repeatedly()
33 assert_eq!(Version::try_from("HTTP/2.0").unwrap(), Version::HTTP2); in sdv_client_send_request_repeatedly()
34 assert_eq!(Version::try_from("HTTP/3.0").unwrap(), Version::HTTP3); in sdv_client_send_request_repeatedly()
35 assert!(Version::try_from("http/1.0").is_err()); in sdv_client_send_request_repeatedly()
36 assert!(Version::try_from("http/1.1").is_err()); in sdv_client_send_request_repeatedly()
37 assert!(Version::try_from("http/2.0").is_err()); in sdv_client_send_request_repeatedly()
38 assert!(Version::try_from("http/3.0").is_err()); in sdv_client_send_request_repeatedly()
/commonlibrary/rust/ylong_http/ylong_http/src/
H A Dheaders.rs70 /// let header = Header::try_from(("Example-Field", "Foo")).unwrap();
111 /// let header = Header::try_from(("Example-Field", "Foo")).unwrap();
129 /// let header = Header::try_from(("Example-Field", "Foo")).unwrap();
148 /// let header = Header::try_from(("Example-Field", "Foo")).unwrap();
168 fn try_from(pair: (N, V)) -> Result<Self, Self::Error> { in try_from() functions
170 HeaderName::try_from(pair.0).map_err(Into::into)?, in try_from()
171 HeaderValue::try_from(pair.1).map_err(Into::into)?, in try_from()
271 fn try_from(name: &str) -> Result<Self, Self::Error> { in try_from() functions
279 fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> { in try_from() functions
491 fn try_from(valu functions
509 fn try_from(value: &[u8]) -> Result<Self, Self::Error> { try_from() functions
[all...]
H A Dversion.rs74 fn try_from(str: &'a str) -> Result<Self, Self::Error> { in try_from() functions
111 /// UT test cases for `Version::try_from`.
114 /// 1. Checks whether `Version::try_from` is correct.
117 assert_eq!(Version::try_from("HTTP/1.0").unwrap(), Version::HTTP1_0); in ut_version_try_from()
118 assert_eq!(Version::try_from("HTTP/1.1").unwrap(), Version::HTTP1_1); in ut_version_try_from()
119 assert_eq!(Version::try_from("HTTP/2.0").unwrap(), Version::HTTP2); in ut_version_try_from()
120 assert_eq!(Version::try_from("HTTP/3.0").unwrap(), Version::HTTP3); in ut_version_try_from()
121 assert!(Version::try_from("http/1.0").is_err()); in ut_version_try_from()
122 assert!(Version::try_from("http/1.1").is_err()); in ut_version_try_from()
123 assert!(Version::try_from("htt in ut_version_try_from()
[all...]
/commonlibrary/rust/ylong_http/ylong_http/src/h3/
H A Doctets.rs29 let bytes: [u8; $len] = <[u8; $len]>::try_from($buf[..$len].as_ref()).unwrap();
/commonlibrary/rust/ylong_http/ylong_http/src/request/
H A Dmod.rs528 part.method = Method::try_from(method).map_err(Into::into)?; in method()
550 part.uri = Uri::try_from(uri).map_err(Into::into)?; in url()
571 part.version = Version::try_from(version).map_err(Into::into)?; in version()
764 *request.uri_mut() = Uri::try_from("www.test.com").unwrap(); in ut_request_builder_build_2()
H A Dmethod.rs172 fn try_from(t: &'a [u8]) -> Result<Self, Self::Error> { in try_from() functions
180 fn try_from(t: &'a str) -> Result<Self, Self::Error> { in try_from() functions
/commonlibrary/rust/ylong_http/ylong_http/src/request/uri/
H A Dmod.rs355 fn try_from(s: &'a [u8]) -> Result<Self, Self::Error> { in try_from() functions
363 fn try_from(s: &'a str) -> Result<Self, Self::Error> { in try_from() functions
616 fn try_from(bytes: &'a [u8]) -> Result<Self, Self::Error> { in try_from() functions
624 fn try_from(s: &'a str) -> Result<Self, Self::Error> { in try_from() functions
625 TryFrom::try_from(s.as_bytes()) in try_from()
730 fn try_from(bytes: &'a [u8]) -> Result<Self, Self::Error> { in try_from() functions
738 fn try_from(s: &'a str) -> Result<Self, Self::Error> { in try_from() functions
739 TryFrom::try_from(s.as_bytes()) in try_from()
913 fn try_from(bytes: &'a [u8]) -> Result<Self, Self::Error> { in try_from() functions
921 fn try_from( in try_from() functions
966 fn try_from(s: &'a [u8]) -> Result<Self, Self::Error> { try_from() functions
974 fn try_from(s: &'a str) -> Result<Self, Self::Error> { try_from() functions
[all...]
/commonlibrary/rust/ylong_http/ylong_http/src/h2/
H A Derror.rs113 fn try_from(value: u32) -> Result<Self, Self::Error> { in try_from() functions
141 /// Unit test cases for `ErrorCode::try_from`.
H A Dframe.rs571 ErrorCode::try_from(self.error_code)?, in error()
/commonlibrary/rust/ylong_http/ylong_http/src/response/
H A Dstatus.rs211 fn try_from(value: u16) -> Result<Self, Self::Error> { in try_from() functions
219 fn try_from(value: &'a [u8]) -> Result<Self, Self::Error> { in try_from() functions
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/
H A Dredirect.rs68 .and_then(|str| Uri::try_from(str.as_bytes()).ok())
H A Dproxy.rs156 let mut uri = match Uri::try_from(uri) {
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/config/
H A Dhttp.rs73 fn try_from(value: &[u8]) -> Result<Self, Self::Error> { in try_from() functions
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/c_openssl/verify/
H A Dpinning.rs96 let parsed = Uri::try_from(uri).map_err(|e| HttpClientError::from_error(Build, e))?; in add()
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/conn/
H A Dhttp2.rs102 ErrorCode::try_from(reset.error_code()).unwrap_or(ErrorCode::ProtocolError), in frame_2_response()
/commonlibrary/rust/ylong_json/src/
H A Dstates.rs330 let unicode = match char::try_from(unicode1 as u32) { in parse_unicode()

Completed in 10 milliseconds