Home
last modified time | relevance | path

Searched refs:as_str (Results 1 - 25 of 47) sorted by relevance

12

/commonlibrary/rust/ylong_http/ylong_http_client/tests/
H A Dsdv_async_http_client_error.rs27 /// 1. assert ErrorKind::as_str.
30 assert_eq!(ErrorKind::BodyDecode.as_str(), "Body Decode Error"); in sdv_client_error_kind()
31 assert_eq!(ErrorKind::BodyTransfer.as_str(), "Body Transfer Error"); in sdv_client_error_kind()
32 assert_eq!(ErrorKind::Build.as_str(), "Build Error"); in sdv_client_error_kind()
33 assert_eq!(ErrorKind::Connect.as_str(), "Connect Error"); in sdv_client_error_kind()
35 ErrorKind::ConnectionUpgrade.as_str(), in sdv_client_error_kind()
38 assert_eq!(ErrorKind::Other.as_str(), "Other Error"); in sdv_client_error_kind()
39 assert_eq!(ErrorKind::Redirect.as_str(), "Redirect Error"); in sdv_client_error_kind()
40 assert_eq!(ErrorKind::Request.as_str(), "Request Error"); in sdv_client_error_kind()
41 assert_eq!(ErrorKind::Timeout.as_str(), "Timeou in sdv_client_error_kind()
[all...]
H A Dsdv_async_http_proxy.rs62 format!("http://{}{}", handle.addr.as_str(), "/data").as_str(), in sdv_async_client_send_request()
76 Addr: handle.addr.as_str(), in sdv_async_client_send_request()
90 response.version().as_str(), in sdv_async_client_send_request()
H A Dsdv_async_https_pinning.rs76 format!("https://127.0.0.1:{}", handle.port).as_str(), in sdv_client_public_key_pinning()
125 format!("https://127.0.0.1:{}", handle.port).as_str(), in sdv_client_public_key_pinning()
254 format!("https://127.0.0.1:{}", handle.port).as_str(), in sdv_client_public_key_pinning_error()
274 .url(format!("{}:{}", "127.0.0.1", handle.port).as_str()) in sdv_client_public_key_pinning_error()
/commonlibrary/rust/ylong_http/ylong_http/src/request/
H A Dmethod.rs27 //! assert_eq!(Method::GET.as_str(), "GET");
41 /// assert_eq!(Method::GET.as_str(), "GET");
113 /// assert_eq!(method.as_str(), "GET");
141 /// assert_eq!(Method::GET.as_str(), "GET");
143 pub fn as_str(&self) -> &str { in as_str() functions
190 /// UT test cases for `Method::as_str`.
193 /// 1. Calls `as_str` for all method kinds.
197 assert_eq!(Method::GET.as_str(), "GET"); in ut_method_as_str()
198 assert_eq!(Method::HEAD.as_str(), "HEAD"); in ut_method_as_str()
199 assert_eq!(Method::POST.as_str(), "POS in ut_method_as_str()
[all...]
H A Dmod.rs729 assert_eq!(request.method().as_str(), "GET"); in ut_request_builder_build()
730 assert_eq!(request.uri().to_string().as_str(), "www.baidu.com"); in ut_request_builder_build()
731 assert_eq!(request.version().as_str(), "HTTP/1.1"); in ut_request_builder_build()
771 assert_eq!(request.method().as_str(), "POST"); in ut_request_builder_build_2()
772 assert_eq!(request.uri().to_string().as_str(), "www.test.com"); in ut_request_builder_build_2()
773 assert_eq!(request.version().as_str(), "HTTP/2.0"); in ut_request_builder_build_2()
787 request.body().to_owned().as_str(), in ut_request_new()
802 assert_eq!(part.method.as_str(), "GET"); in ut_request_into_parts()
803 assert_eq!(body.as_str(), "<body><div></div></body>"); in ut_request_into_parts()
816 assert_eq!(part.method.as_str(), "GE in ut_request_part()
[all...]
/commonlibrary/rust/ylong_http/ylong_http/tests/
H A Dsdv_http_version.rs23 /// 3. Invoke the as_str method.
27 assert_eq!(Version::HTTP1_0.as_str(), "HTTP/1.0"); in sdv_client_send_request_repeatedly()
28 assert_eq!(Version::HTTP1_1.as_str(), "HTTP/1.1"); in sdv_client_send_request_repeatedly()
29 assert_eq!(Version::HTTP2.as_str(), "HTTP/2.0"); in sdv_client_send_request_repeatedly()
30 assert_eq!(Version::HTTP3.as_str(), "HTTP/3.0"); in sdv_client_send_request_repeatedly()
/commonlibrary/rust/ylong_http/ylong_http/src/request/uri/
H A Dmod.rs67 /// assert_eq!(uri.scheme().unwrap().as_str(), "http");
68 /// assert_eq!(uri.host().unwrap().as_str(), "example.com");
69 /// assert_eq!(uri.port().unwrap().as_str(), "80");
70 /// assert_eq!(uri.path().unwrap().as_str(), "/foo");
71 /// assert_eq!(uri.query().unwrap().as_str(), "a=1");
128 /// assert_eq!(uri.scheme().unwrap().as_str(), "http");
145 /// assert_eq!(authority.host().as_str(), "example.com");
146 /// assert_eq!(authority.port().unwrap().as_str(), "80");
162 /// assert_eq!(uri.host().unwrap().as_str(), "example.com");
178 /// assert_eq!(uri.port().unwrap().as_str(), "8
582 pub fn as_str(&self) -> &str { as_str() functions
773 pub fn as_str(&self) -> &str { as_str() functions
826 pub fn as_str(&self) -> &str { as_str() functions
905 pub fn as_str(&self) -> &str { as_str() functions
958 pub fn as_str(&self) -> &str { as_str() functions
[all...]
/commonlibrary/rust/ylong_http/ylong_http_client/tests/tcp_server/
H A Dmod.rs96 format!("{} http://{}{} {}{}", $method, addr.to_string().as_str(), $path, $req_version, crlf)
103 let host = format_header_str("host", addr.to_string().as_str());
104 assert!(request_str.contains(host.as_str()), "Incorrect host header!");
109 assert!(request_str.contains(header_str.as_str()), "Incorrect {} header!", $req_n);
128 resp_str.push_str(header.as_str());
203 assert!(request_str.contains(accept.as_str()), "Incorrect accept header!");
206 let host = format_header_str("host", addr.to_string().as_str());
207 assert!(request_str.contains(host.as_str()), "Incorrect host header!");
212 assert!(request_str.contains(header_str.as_str()), "Incorrect {} header!", $req_n);
230 resp_str.push_str(header.as_str());
[all...]
H A Dasync_utils.rs191 Addr: $handle.addr.as_str(),
205 assert_eq!(response.version().as_str(), $resp_version, "Assert response version failed");
210 .expect(format!("Get response header \"{}\" failed", $resp_n).as_str())
212 .expect(format!("Convert response header \"{}\"into string failed", $resp_n).as_str()),
H A Dsync_utils.rs182 Addr: $handle.addr.as_str(),
194 assert_eq!(response.version().as_str(), $version, "Assert response version failed");
199 .expect(format!("Get response header \"{}\" failed", $resp_n).as_str())
201 .expect(format!("Convert response header \"{}\"into string failed", $resp_n).as_str()),
/commonlibrary/rust/ylong_http/ylong_http_client/src/
H A Derror.rs191 f.write_str(self.kind.as_str())?; in fmt()
255 /// assert_eq!(ErrorKind::UserAborted.as_str(), "User Aborted Error");
257 pub fn as_str(&self) -> &'static str { in as_str() functions
341 /// UT test cases for `ErrorKind::as_str`.
344 /// 1. Transfer ErrorKind to str a by calling `ErrorKind::as_str`.
348 assert_eq!(ErrorKind::BodyDecode.as_str(), "Body Decode Error"); in ut_err_as_str()
349 assert_eq!(ErrorKind::BodyTransfer.as_str(), "Body Transfer Error"); in ut_err_as_str()
350 assert_eq!(ErrorKind::Build.as_str(), "Build Error"); in ut_err_as_str()
351 assert_eq!(ErrorKind::Connect.as_str(), "Connect Error"); in ut_err_as_str()
353 ErrorKind::ConnectionUpgrade.as_str(), in ut_err_as_str()
[all...]
/commonlibrary/rust/ylong_runtime/ylong_runtime/tests/
H A Dasync_pool.rs50 let dir = format!("/proc/{}/task", current_pid.to_string().as_str()); in dump_dir()
53 for entry in fs::read_dir(dir.as_str()).expect("read failed") { in dump_dir()
64 current_pid.to_string().as_str(), in name_of_pid()
139 if let Some(name) = name_of_pid(pid.to_string().as_str()) { in sdv_async_pool_001()
199 if let Some(name) = name_of_pid(pid.to_string().as_str()) { in sdv_async_pool_002()
259 if let Some(name) = name_of_pid(pid.to_string().as_str()) { in sdv_async_pool_003()
319 if let Some(name) = name_of_pid(pid.to_string().as_str()) { in sdv_async_pool_004()
379 if let Some(name) = name_of_pid(pid.to_string().as_str()) { in sdv_async_pool_005()
439 if let Some(name) = name_of_pid(pid.to_string().as_str()) { in sdv_async_pool_006()
499 if let Some(name) = name_of_pid(pid.to_string().as_str()) { in sdv_async_pool_007()
[all...]
/commonlibrary/rust/ylong_http/ylong_http_client/tests/common/
H A Dmod.rs234 .url(format!("{}:{}", $host, $port).as_str())
258 .url(format!("{}:{}", $host, $port).as_str())
288 match request.method().as_str() {
292 assert_eq!($method, request.method().as_str(), "Assert request method failed");
308 .expect(format!("Get request header \"{}\" failed", $req_n).as_str())
310 .expect(format!("Convert request header \"{}\" into string failed", $req_n).as_str()),
351 match request.method().as_str() {
355 assert_eq!($method, request.method().as_str(), "Assert request method failed");
371 .expect(format!("Get request header \"{}\" failed", $req_n).as_str())
373 .expect(format!("Convert request header \"{}\" into string failed", $req_n).as_str()),
[all...]
H A Dasync_utils.rs339 .url(format!("{}:{}", $host, $handle.port).as_str())
350 assert_eq!(response.version().as_str(), $version, "Assert response version failed");
355 .expect(format!("Get response header \"{}\" failed", $resp_n).as_str())
357 .expect(format!("Convert response header \"{}\"into string failed", $resp_n).as_str()),
H A Dsync_utils.rs351 assert_eq!(response.version().as_str(), $version, "Assert response version failed");
356 .expect(format!("Get response header \"{}\" failed", $resp_n).as_str())
358 .expect(format!("Convert response header \"{}\"into string failed", $resp_n).as_str()),
/commonlibrary/rust/ylong_http/ylong_http/src/h2/
H A Dparts.rs55 Header::Other(header) => self.map.append(header.as_str(), value.as_str()).unwrap(),
/commonlibrary/rust/ylong_http/ylong_http/src/response/
H A Dmod.rs127 assert_eq!(response.version().as_str(), "HTTP/1.1") in ut_response_version()
227 assert_eq!(part.version.as_str(), "HTTP/1.1"); in ut_response_into_parts()
243 assert_eq!(response.version().as_str(), "HTTP/1.1"); in ut_response_from_raw_parts()
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/c_openssl/verify/
H A Dpinning.rs102 format!("{}:{}", host.as_str(), port.as_str()) in add()
105 format!("{}:443", host.as_str()) in add()
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/connector/
H A Dmod.rs175 let stream = eyeballs_connect(resolver, addr.as_str(), timeout).await?; in connect()
246 let stream = eyeballs_connect(resolver, addr.as_str(), timeout).await?; in connect()
326 let stream = eyeballs_connect(resolver, addr.as_str(), timeout).await?; in connect()
382 let pinned_key = config.pinning_host_match(addr.as_str());
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()
723 Body: body.as_str(), in ut_ssl_tunnel_resp_beyond_size()
729 vec![SocketAddr::from_str(handle.addr.as_str()) in ut_ssl_tunnel_resp_beyond_size()
[all...]
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/
H A Drequest.rs210 format!("{}", slice.get_ref().len()).as_str(), in body()
219 builder = builder.header("Content-Type", value.as_str()); in body()
222 builder = builder.header("Content-Length", format!("{size}").as_str()); in body()
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/net/sys/tcp/
H A Dsplit.rs151 String::from_utf8(Vec::from(buf)).unwrap().as_str(), in poll_flush()
161 String::from_utf8(Vec::from(buf)).unwrap().as_str(), in poll_flush()
198 String::from_utf8(Vec::from(buf)).unwrap().as_str(), in poll_flush()
208 String::from_utf8(Vec::from(buf)).unwrap().as_str(), in poll_flush()
/commonlibrary/rust/ylong_http/ylong_http/src/h3/
H A Dparts.rs57 NameField::Other(header) => self.map.append(header.as_str(), value.as_str()).unwrap(), in update()
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/
H A Dtest_utils.rs48 .url(format!("http://{}{}",$addr, $path).as_str())
108 resp_str.push_str(header.as_str());
/commonlibrary/rust/ylong_http/ylong_http/src/
H A Dversion.rs37 /// assert_eq!(Version::HTTP1_1.as_str(), "HTTP/1.1");
59 /// assert_eq!(Version::HTTP1_1.as_str(), "HTTP/1.1");
61 pub fn as_str(&self) -> &str { in as_str() functions
99 /// UT test cases for `Version::as_str`.
102 /// 1. Checks whether `Version::as_str` is correct.
105 assert_eq!(Version::HTTP1_0.as_str(), "HTTP/1.0"); in ut_version_as_str()
106 assert_eq!(Version::HTTP1_1.as_str(), "HTTP/1.1"); in ut_version_as_str()
107 assert_eq!(Version::HTTP2.as_str(), "HTTP/2.0"); in ut_version_as_str()
108 assert_eq!(Version::HTTP3.as_str(), "HTTP/3.0"); in ut_version_as_str()
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/conn/
H A Dhttp2.rs170 if te.as_str() != "trailers" { in remove_connection_specific_headers()
181 pseudo.set_scheme(Some(String::from(scheme.as_str()))); in build_pseudo_headers()
183 None => pseudo.set_scheme(Some(String::from(Scheme::HTTP.as_str()))), in build_pseudo_headers()
185 pseudo.set_method(Some(String::from(request_part.method.as_str()))); in build_pseudo_headers()

Completed in 45 milliseconds

12