/commonlibrary/rust/ylong_http/ylong_http/src/h3/qpack/ |
H A D | table.rs | 313 /// Note that the QPACK static table is indexed from 0, 314 /// whereas the HPACK static table is indexed from 1. 329 2 => Some(NameField::Other(String::from("age"))), in field_name() 330 3 => Some(NameField::Other(String::from("content-disposition"))), in field_name() 331 4 => Some(NameField::Other(String::from("content-length"))), in field_name() 332 5 => Some(NameField::Other(String::from("cookie"))), in field_name() 333 6 => Some(NameField::Other(String::from("date"))), in field_name() 334 7 => Some(NameField::Other(String::from("etag"))), in field_name() 335 8 => Some(NameField::Other(String::from("if-modified-since"))), in field_name() 336 9 => Some(NameField::Other(String::from("i in field_name() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h2/hpack/ |
H A D | encoder.rs | 96 /// The following test cases are from RFC7541. in ut_hpack_encoder() 103 Header::Other(String::from("custom-key")), in ut_hpack_encoder() 104 String::from("custom-header"), in ut_hpack_encoder() 117 String::from("GET"), in ut_hpack_encoder() 130 String::from("GET"), in ut_hpack_encoder() 132 String::from("http"), in ut_hpack_encoder() 134 String::from("/"), in ut_hpack_encoder() 136 String::from("www.example.com"), in ut_hpack_encoder() 146 String::from("GET"), in ut_hpack_encoder() 148 String::from("htt in ut_hpack_encoder() [all...] |
H A D | table.rs | 212 /// | 37 | from | | 248 15 => Some(Header::Other(String::from("accept-charset"))), in header_name() 249 16 => Some(Header::Other(String::from("accept-encoding"))), in header_name() 250 17 => Some(Header::Other(String::from("accept-language"))), in header_name() 251 18 => Some(Header::Other(String::from("accept-ranges"))), in header_name() 252 19 => Some(Header::Other(String::from("accept"))), in header_name() 253 20 => Some(Header::Other(String::from("access-control-allow-origin"))), in header_name() 254 21 => Some(Header::Other(String::from("age"))), in header_name() 255 22 => Some(Header::Other(String::from("allow"))), in header_name() 256 23 => Some(Header::Other(String::from("authorizatio in header_name() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h2/ |
H A D | pseudo.rs | 190 pseudo.authority = Some(String::from("authority")); in ut_pseudo_headers_contains_authority() 206 pseudo.authority = Some(String::from("authority")); in ut_pseudo_headers_authority() 222 pseudo.set_authority(Some(String::from("authority"))); in ut_pseudo_headers_set_authority() 242 pseudo.authority = Some(String::from("authority")); in ut_pseudo_headers_take_authority() 243 assert_eq!(pseudo.take_authority(), Some(String::from("authority"))); in ut_pseudo_headers_take_authority() 259 pseudo.method = Some(String::from("method")); in ut_pseudo_headers_contains_method() 275 pseudo.method = Some(String::from("method")); in ut_pseudo_headers_method() 290 pseudo.set_method(Some(String::from("method"))); in ut_pseudo_headers_set_method() 309 pseudo.method = Some(String::from("method")); in ut_pseudo_headers_take_method() 310 assert_eq!(pseudo.take_method(), Some(String::from("metho in ut_pseudo_headers_take_method() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h3/ |
H A D | pseudo.rs | 189 pseudo.authority = Some(String::from("authority")); in ut_pseudo_headers_contains_authority() 205 pseudo.authority = Some(String::from("authority")); in ut_pseudo_headers_authority() 221 pseudo.set_authority(Some(String::from("authority"))); in ut_pseudo_headers_set_authority() 241 pseudo.authority = Some(String::from("authority")); in ut_pseudo_headers_take_authority() 242 assert_eq!(pseudo.take_authority(), Some(String::from("authority"))); in ut_pseudo_headers_take_authority() 258 pseudo.method = Some(String::from("method")); in ut_pseudo_headers_contains_method() 274 pseudo.method = Some(String::from("method")); in ut_pseudo_headers_method() 289 pseudo.set_method(Some(String::from("method"))); in ut_pseudo_headers_set_method() 308 pseudo.method = Some(String::from("method")); in ut_pseudo_headers_take_method() 309 assert_eq!(pseudo.take_method(), Some(String::from("metho in ut_pseudo_headers_take_method() [all...] |
H A D | error.rs | 59 /// The payload length resolved is different from the actual data. 130 fn from(value: u64) -> Self { in from() functions 159 fn from(value: QpackError) -> Self { in from() functions 165 fn from(value: QpackError) -> Self { in from() functions 171 fn from(value: EncodeError) -> Self { in from() functions 177 fn from(value: DecodeError) -> Self { in from() functions 183 fn from(value: CommonError) -> Self { in from() functions 189 fn from(_value: Infallible) -> Self { in from() functions
|
H A D | decoder.rs | 235 let reader = ReadableBytes::from(&stream.buffer.as_slice()[stream.offset..]); in decode() 236 let inst = Vec::from(reader.remaining()); in decode() 242 let reader = ReadableBytes::from(&stream.buffer.as_slice()[stream.offset..]); in decode() 381 let mut reader = ReadableBytes::from(&self.buffer.as_slice()[self.offset..]); in decode_stream_type() 399 let mut reader = ReadableBytes::from(&self.buffer.as_slice()[self.offset..]); in decode_push_id() 417 let mut reader = ReadableBytes::from(&self.buffer.as_slice()[self.offset..]); in decode_frame_type() 462 let mut reader = ReadableBytes::from(&self.buffer.as_slice()[self.offset..]); in decode_payload_len() 507 let mut reader = ReadableBytes::from(&self.buffer.as_slice()[self.offset..]); in decode_data_payload() 514 Payload::Data(Data::new(Vec::from(reader.remaining()))), in decode_data_payload() 518 frames.push(FrameKind::Complete(Box::from(fram in decode_data_payload() [all...] |
/commonlibrary/rust/ylong_json/tests/ |
H A D | sdv_adapt_serde_test.rs | 55 "Title": "View from 15th Floor", 75 url: String::from("http://www.example.com/image/481989943"), in sdv_adapt_serde_example_one() 81 title: String::from("View from 15th Floor"), in sdv_adapt_serde_example_one() 135 precision: String::from("zip"), in sdv_adapt_serde_example_two() 138 address: String::from(""), in sdv_adapt_serde_example_two() 139 city: String::from("SAN FRANCISCO"), in sdv_adapt_serde_example_two() 140 state: String::from("CA"), in sdv_adapt_serde_example_two() 141 zip: Cow::from("94107"), in sdv_adapt_serde_example_two() 142 country: Cow::from("U in sdv_adapt_serde_example_two() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/ |
H A D | error.rs | 42 fn from(kind: ErrorKind) -> Self { in from() functions 48 fn from(err: InvalidUri) -> Self { in from() functions 55 fn from(err: H2Error) -> Self { in from() functions 62 fn from(err: H3Error) -> Self { in from() functions 68 fn from(_value: Infallible) -> Self { in from() functions
|
/commonlibrary/rust/ylong_runtime/ylong_runtime/src/net/sys/ |
H A D | addr.rs | 220 let expected_addr = SocketAddr::from(([127, 0, 0, 1], 8080)); in ut_to_socket_addrs_str() 242 let expected_addr1 = SocketAddr::from(([127, 0, 0, 1], 8080)); in ut_to_socket_addrs_blocking() 243 let expected_addr2 = SocketAddr::from(([0, 0, 0, 0, 0, 0, 0, 1], 8080)); in ut_to_socket_addrs_blocking() 261 let expected_addr = SocketAddr::from(([127, 0, 0, 1], 8080)); in ut_to_socket_addrs_str_u16() 274 let expected_addr1 = SocketAddr::from(([127, 0, 0, 1], 8080)); in ut_to_socket_addrs_str_u16() 275 let expected_addr2 = SocketAddr::from(([0, 0, 0, 0, 0, 0, 0, 1], 8080)); in ut_to_socket_addrs_str_u16() 283 let expected_addr = SocketAddr::from(([0, 0, 0, 0, 0, 0, 0, 1], 8080)); in ut_to_socket_addrs_str_u16() 301 let expected_addr = SocketAddr::from(([127, 0, 0, 1], 8080)); in ut_to_socket_addrs_ipaddr_u16() 310 let expected_addr = SocketAddr::from(([0, 0, 0, 0, 0, 0, 0, 1], 8080)); in ut_to_socket_addrs_ipaddr_u16() 328 let expected_addr = SocketAddr::from(([12 in ut_to_socket_addrs_ipv4addr_u16() [all...] |
/commonlibrary/rust/ylong_runtime/ylong_runtime_macros/src/ |
H A D | lib.rs | 55 group_inner.extend(TokenStream::from(TokenTree::from(punct))); in tuple_form() 61 TokenStream::from(TokenTree::from(tuple)) in tuple_form()
|
/commonlibrary/rust/ylong_http/ylong_http/src/request/ |
H A D | method.rs | 228 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_method_from_bytes() 234 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_method_from_bytes() 240 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_method_from_bytes() 246 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_method_from_bytes() 252 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_method_from_bytes() 256 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_method_from_bytes() 260 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_method_from_bytes()
|
/commonlibrary/rust/ylong_json/src/value/ |
H A D | index.rs | 21 /// Gets a common reference to the value with the specified subscript (or key) from a JsonValue. 24 /// Gets a mutable reference to the value of the specified subscript (or key) from a JsonValue. in index_into() 27 /// Removes the member with the specified subscript (or key) from a JsonValue. in index_into() 163 /// object.insert(String::from("key"), JsonValue::Number(0.0.into())); 196 /// object.insert(String::from("key"), JsonValue::Number(0.0.into())); 203 /// object.insert(String::from("key"), JsonValue::Number(0.0.into())); 227 object.insert(String::from(self), JsonValue::Null); in index_into_mut() 233 object.insert(String::from(self), JsonValue::Null); in index_into_mut() 249 /// object.insert(String::from("key"), "value".into()); 442 assert!(String::from("ke in ut_string_index_into() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/response/ |
H A D | status.rs | 486 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_u16() 490 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_u16() 524 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_bytes() 530 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_bytes() 534 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_bytes() 540 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_bytes() 544 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_bytes() 548 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_bytes() 552 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_status_code_from_bytes() 556 Err(HttpError::from(ErrorKin in ut_status_code_from_bytes() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h2/hpack/representation/ |
H A D | encoder.rs | 42 /// Loads states from a holder. 86 // If `self.iter` is not `None`, select the next one from the iterator 170 /// Creates a new `PartsIter` from the given `Parts`. 244 fn from(index: Integer) -> Self { in from() functions 257 .map_err(|e| ReprEncodeState::Indexed(Indexed::from(e))) in encode() 273 fn from(inner: IndexAndValue) -> Self { in from() functions 280 .map_err(|e| ReprEncodeState::Indexing(Indexing::from(e))) in encode() 296 fn from(inner: NameAndValue) -> Self { in from() functions 303 .map_err(|e| ReprEncodeState::IndexingWithName(IndexingWithName::from(e))) in encode() 319 fn from(inne functions 342 fn from(inner: NameAndValue) -> Self { from() functions 365 fn from(inner: IndexAndValue) -> Self { from() functions 388 fn from(inner: NameAndValue) -> Self { from() functions [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/util/c_openssl/ssl/ |
H A D | error.rs | 152 fn from(e: ErrorStack) -> HandshakeError<S> { in from() functions 213 internal: Some(InternalError::Io(io::Error::from( in ut_ssl_error_into_io_error() 236 internal: Some(InternalError::Io(io::Error::from( in ut_ssl_error_source() 270 internal: Some(InternalError::Io(io::Error::from( in ut_ssl_error_fmt() 278 internal: Some(InternalError::Io(io::Error::from( in ut_ssl_error_fmt() 286 io::Error::from(io::ErrorKind::BrokenPipe) in ut_ssl_error_fmt() 318 internal: Some(InternalError::Io(io::Error::from( in ut_ssl_error_fmt() 326 io::Error::from(io::ErrorKind::BrokenPipe) in ut_ssl_error_fmt() 341 internal: Some(InternalError::Io(io::Error::from( in ut_ssl_error_fmt() 349 io::Error::from(i in ut_ssl_error_fmt() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/h1/response/ |
H A D | decoder.rs | 264 .map_err(|_| HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))?, 908 test_unit_invalid!("HTTP/1.2 304 OK\r\nAge:270646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))); in ut_response_decoder_decode_2() 909 test_unit_invalid!("HTTP/1.1 3040 OK\r\nAge:270646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))); in ut_response_decoder_decode_2() 910 test_unit_invalid!("HTTP/1.1 3 4 OK\r\nAge:270646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))); in ut_response_decoder_decode_2() 911 test_unit_invalid!("HTTP/1.1 304 \0K\r\nAge:270646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))); in ut_response_decoder_decode_2() 912 test_unit_invalid!("HTTP/1.1 304 OK\r\r\nAge:270646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))); in ut_response_decoder_decode_2() 913 test_unit_invalid!("HTTP/1.1 304 OK\r\nA;ge:270646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))); in ut_response_decoder_decode_2() 914 test_unit_invalid!("HTTP/1.1 304 OK\r\nA;ge:270646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))); in ut_response_decoder_decode_2() 915 test_unit_invalid!("HTTP/1.1 304 OK\r\nAge:270\r646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKind::H1(H1Error::InvalidResponse)))); in ut_response_decoder_decode_2() 916 test_unit_invalid!("HTTP/1.1 304 OK\r\nAge:270\r646\r\nDate:Mon, 19 Dec 2022 01:46:59 GMT\r\nEtag:\"3147526947+gzip\"\r\n\r\nbody part".as_bytes(), Some(HttpError::from(ErrorKin in ut_response_decoder_decode_2() [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/conn/ |
H A D | http2.rs | 84 HttpError::from(H2Error::StreamError( in frame_2_response() 100 HttpError::from(H2Error::StreamError( in frame_2_response() 109 HttpError::from(H2Error::StreamError( in frame_2_response() 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() 190 .or_else(|| Some(String::from("/"))), in build_pseudo_headers() 276 HttpError::from(H2Error::ConnectionError(ErrorCode::ProtocolError)), in match_channel_message() 282 HttpError::from(H2Error::ConnectionError(ErrorCode::ProtocolError)), in match_channel_message() 332 HttpError::from(H2Erro in read_remaining_data() [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/tests/ |
H A D | sdv_sync_https_c_ssl.rs | 33 let mut path = PathBuf::from(dir); in sdv_synchronized_client_send_request() 59 let mut path = PathBuf::from(dir); in sdv_synchronized_client_send_request_repeatedly()
|
H A D | sdv_async_https_c_ssl.rs | 32 let mut path = PathBuf::from(dir); in sdv_async_client_send_request() 136 let mut path = PathBuf::from(dir); in sdv_client_send_request_repeatedly() 174 let mut path = PathBuf::from(dir); in sdv_client_making_multiple_connections()
|
/commonlibrary/rust/ylong_json/src/ |
H A D | value.rs | 163 /// assert_eq!(value, JsonValue::String(String::from("Hello World"))); in fmt() 174 let result = Self::String(JsonString::from(str)); in fmt() 365 /// assert_eq!(number_value.try_as_number().unwrap(), &Number::from(0.0)); in fmt() 389 /// assert_eq!(string_value.try_as_string().unwrap(), &String::from("Hello World")); in fmt() 467 /// assert_eq!(number_value.try_as_mut_number().unwrap(), &mut Number::from(0.0)); in fmt() 491 /// assert_eq!(string_value.try_as_mut_string().unwrap(), &mut String::from("Hello World")); in fmt() 573 /// assert_eq!(number_value.try_into_number().unwrap(), Number::from(0.0)); in fmt() 598 /// assert_eq!(string_value.try_into_string().unwrap(), String::from("Hello World")); in fmt() 653 /// gets value of the member from the Object or Array. in fmt() 660 /// object.insert(String::from("ke in fmt() 897 fn from(t: &str) -> Self { from() functions 919 fn from(t: JsonString) -> Self { from() functions 935 fn from(t: $type) -> Self { from() functions 949 fn from(t: &$type) -> Self { from() functions 963 fn from(t: &mut $type) -> Self { from() functions 983 fn from(t: $type) -> Self { from() functions [all...] |
/commonlibrary/rust/ylong_http/ylong_http_client/src/async_impl/dns/ |
H A D | happy_eyeballs.rs | 269 let local_v4_addr = IpAddr::from(Ipv4Addr::new(127, 0, 0, 1)); in ut_happy_eyeballs_connect() 270 let local_v6_addr = IpAddr::from(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)); in ut_happy_eyeballs_connect() 271 let invalid_v4_addr = IpAddr::from(Ipv4Addr::new(127, 0, 0, 2)); in ut_happy_eyeballs_connect() 272 let invalid_v6_addr = IpAddr::from(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 2)); in ut_happy_eyeballs_connect() 273 let internet_v4_addr = IpAddr::from(Ipv4Addr::new(198, 18, 0, 25)); in ut_happy_eyeballs_connect() 347 &SocketAddr::from((addr, 80)), in ut_happy_eyeballs_connect()
|
/commonlibrary/rust/ylong_http/ylong_http_client/src/ |
H A D | error.rs | 88 /// Gets the `io::Error` if this `HttpClientError` comes from an 91 /// Returns `None` if the `HttpClientError` doesn't come from an 384 HttpClientError::from_io_error(ErrorKind::Build, io::Error::from(io::ErrorKind::Other)); in ut_err_from_io_error() 428 io::Error::from(io::ErrorKind::BrokenPipe), in ut_client_err_io_error() 444 io::Error::from(io::ErrorKind::BrokenPipe), in ut_client_err_debug_fmt() 457 let error = HttpClientError::other(io::Error::from(io::ErrorKind::BrokenPipe)); in ut_client_err_debug_fmt() 473 io::Error::from(io::ErrorKind::BrokenPipe), in ut_client_err_display_fmt() 480 let error = HttpClientError::other(io::Error::from(io::ErrorKind::BrokenPipe)); in ut_client_err_display_fmt()
|
/commonlibrary/rust/ylong_http/ylong_http/src/request/uri/ |
H A D | mod.rs | 260 /// assert_eq!(uri.path_and_query().unwrap(), String::from("/foo?a=1")); 287 /// assert_eq!(auth.unwrap().to_string(), String::from("example.com:80")); 303 /// Creates an `Uri` from `Scheme`, `Authority`, `Path`, `Query`. 608 fn from(proto: Protocol) -> Self { in from() functions 781 /// Constructs host from a string slice. 797 Ok(Self(String::from(host))) in from_str() 851 /// Constructs host from a string slice. 865 Ok(Self(String::from(port))) in from_str() 1022 fn from(_: Infallible) -> Self { in from() functions 1462 Err(HttpError::from(ErrorKin in ut_uri_from_bytes() [all...] |
/commonlibrary/rust/ylong_http/ylong_http/src/body/mime/ |
H A D | mimetype.rs | 51 /// Creates a `MimeType` from a bytes slice. 71 .ok_or_else(|| HttpError::from(ErrorKind::InvalidInput))?; in from_bytes() 83 /// Creates a new `MimeType` from a file path. The extension of the file 102 .ok_or_else(|| HttpError::from(ErrorKind::InvalidInput))?; in from_path() 308 /// Creates a new `MimeType` from file extension. 342 /// 1. Creates a `MimeType` from file extension. 711 /// 1. Creates a `MimeTypeTag` from `&[u8]`. 740 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_mime_type_tag_from_bytes() 744 Err(HttpError::from(ErrorKind::InvalidInput)) in ut_mime_type_tag_from_bytes() 751 /// 1. Creates a `MimeType` from ` [all...] |