Home
last modified time | relevance | path

Searched refs:from_bytes (Results 1 – 25 of 54) sorted by relevance

123

/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/request/
H A Dmethod.rs115 pub fn from_bytes(bytes: &[u8]) -> Result<Method, HttpError> { in from_bytes() method
173 Self::from_bytes(t) in try_from()
181 Self::from_bytes(t.as_bytes()) in try_from()
215 assert_eq!(Method::from_bytes(b"GET").unwrap(), Method::GET); in ut_method_from_bytes()
227 Method::from_bytes(b""), in ut_method_from_bytes()
233 Method::from_bytes(b"G"), in ut_method_from_bytes()
239 Method::from_bytes(b"CONNECTT"), in ut_method_from_bytes()
245 Method::from_bytes(b"Get"), in ut_method_from_bytes()
251 Method::from_bytes(b"PATC"), in ut_method_from_bytes()
255 Method::from_bytes(b"PATCHH"), in ut_method_from_bytes()
[all …]
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/body/mime/
H A Dmimetype.rs716 MimeTypeTag::from_bytes(b"application"), in ut_mime_type_tag_from_bytes()
723 MimeTypeTag::from_bytes(b"message"), in ut_mime_type_tag_from_bytes()
728 MimeTypeTag::from_bytes(b"multipart"), in ut_mime_type_tag_from_bytes()
735 MimeTypeTag::from_bytes(b"APPLICATION"), in ut_mime_type_tag_from_bytes()
739 MimeTypeTag::from_bytes(b"x-ab/cd"), in ut_mime_type_tag_from_bytes()
743 MimeTypeTag::from_bytes(b"notype"), in ut_mime_type_tag_from_bytes()
765 MimeType::from_bytes(b"TEXT/PLAIN"), in ut_mime_type_from_bytes()
774 MimeType::from_bytes(b"TEXT/~PLAIN"), in ut_mime_type_from_bytes()
878 MimeType::from_bytes(b"application/pdf") in ut_mime_type_eq()
883 MimeType::from_bytes(b"application/pdf") in ut_mime_type_eq()
[all …]
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/response/
H A Dstatus.rs220 Self::from_bytes(value) in try_from()
516 StatusCode::from_bytes(b"500"), in ut_status_code_from_bytes()
519 assert!(StatusCode::from_bytes(b"999").is_ok()); in ut_status_code_from_bytes()
524 StatusCode::from_bytes(b""), in ut_status_code_from_bytes()
530 StatusCode::from_bytes(b"1"), in ut_status_code_from_bytes()
534 StatusCode::from_bytes(b"1000"), in ut_status_code_from_bytes()
540 StatusCode::from_bytes(b"099"), in ut_status_code_from_bytes()
544 StatusCode::from_bytes(b"a99"), in ut_status_code_from_bytes()
548 StatusCode::from_bytes(b"1a9"), in ut_status_code_from_bytes()
552 StatusCode::from_bytes(b"19a"), in ut_status_code_from_bytes()
[all …]
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/tests/
H A Dsdv_http_headers.rs27 let name = HeaderName::from_bytes(b"John-Doe").unwrap(); in sdv_client_send_request_repeatedly()
28 let value = HeaderValue::from_bytes(b"Foo").unwrap(); in sdv_client_send_request_repeatedly()
35 format!("{:?}", HeaderValue::from_bytes(b"Foo\r\n").err().unwrap()), in sdv_client_send_request_repeatedly()
38 let mut value = HeaderValue::from_bytes(b"Foo").unwrap(); in sdv_client_send_request_repeatedly()
48 let mut value = HeaderValue::from_bytes(b"value").unwrap(); in sdv_client_send_request_repeatedly()
H A Dsdv_http_body.rs111 let mut task = ChunkBody::from_bytes(content.as_slice()); in sdv_async_chunk_body_from_bytes()
140 let mut task = ChunkBody::from_bytes(content.as_slice()).set_trailer(headers); in sdv_chunk_body_encode_trailer_0()
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http_client/src/util/
H A Dnormalizer.rs240 let mut uri = Uri::from_bytes(b"http://example.com").unwrap(); in ut_uri_format()
256 *request_uri = Uri::from_bytes(b"http://example1.com").unwrap(); in ut_request_format()
321 let uri = Uri::from_bytes(b"https://www.example.com:80").expect("Uri parse failed"); in ut_format_host_value()
323 let uri = Uri::from_bytes(b"https://www.example.com:443").expect("Uri parse failed"); in ut_format_host_value()
325 let uri = Uri::from_bytes(b"http://www.example.com:80").expect("Uri parse failed"); in ut_format_host_value()
327 let uri = Uri::from_bytes(b"http://www.example.com:443").expect("Uri parse failed"); in ut_format_host_value()
329 let uri = Uri::from_bytes(b"www.example.com:443").expect("Uri parse failed"); in ut_format_host_value()
331 let uri = Uri::from_bytes(b"www.example.com:80").expect("Uri parse failed"); in ut_format_host_value()
333 let uri = Uri::from_bytes(b"www.example.com").expect("Uri parse failed"); in ut_format_host_value()
H A Dproxy.rs80 let mut auth = HeaderValue::from_bytes(auth.as_slice()).unwrap(); in basic_auth()
204 let address = match Uri::from_bytes(host.as_bytes()) { in from_str()
280 let uri = Uri::from_bytes(b"http://www.example2.com").unwrap(); in ut_via_proxy()
298 let uri = Uri::from_bytes(b"http://www.example.com").unwrap(); in ut_proxies()
305 let uri = Uri::from_bytes(b"https://www.example.com").unwrap(); in ut_proxies()
318 let uri = Uri::from_bytes(b"http://www.bbb.com").unwrap(); in ut_proxies()
324 let uri = Uri::from_bytes(b"http://no_proxy.aaa.com").unwrap(); in ut_proxies()
332 let uri = Uri::from_bytes(b"http://no_proxy.aaa.com").unwrap(); in ut_proxies()
340 let uri = Uri::from_bytes(b"http://127.0.0.1:80").unwrap(); in ut_proxies()
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/
H A Dheaders.rs210 pub fn from_bytes(bytes: &[u8]) -> Result<Self, HttpError> { in from_bytes() method
272 Self::from_bytes(name.as_bytes()) in try_from()
280 Self::from_bytes(bytes) in try_from()
327 pub fn from_bytes(bytes: &[u8]) -> Result<Self, HttpError> { in from_bytes() method
492 Self::from_bytes(value.as_bytes()) in try_from()
510 Self::from_bytes(value) in try_from()
1004 HeaderName::from_bytes(b"ACCEPT"), in ut_header_name_from_bytes()
1007 assert_eq!(HeaderName::from_bytes(b"accept"), Ok(HeaderName { name })); in ut_header_name_from_bytes()
1049 let name = HeaderName::from_bytes(b"John-Doe").unwrap(); in ut_header_methods()
1050 let value = HeaderValue::from_bytes(b"Foo").unwrap(); in ut_header_methods()
[all …]
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/request/uri/
H A Dmod.rs98 path: Path::from_bytes(b"/").ok(), in http()
225 pub fn from_bytes(bytes: &[u8]) -> Result<Self, HttpError> { in from_bytes() method
356 Self::from_bytes(s) in try_from()
364 Self::from_bytes(s.as_bytes()) in try_from()
617 Scheme::from_bytes(bytes) in try_from()
731 Authority::from_bytes(bytes) in try_from()
869 Path::from_bytes(bytes) in try_from()
922 Query::from_bytes(s) in try_from()
1383 let scheme = Scheme::from_bytes(b"http").unwrap(); in ut_uri_scheme_default_port()
1385 let scheme = Scheme::from_bytes(b"https").unwrap(); in ut_uri_scheme_default_port()
[all …]
/ohos5.0/base/telephony/core_service/utils/common/src/
H A Dstr_convert.cpp24 return std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(str); in ToUtf16()
34 return std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> {}.from_bytes(str); in ToUtf32()
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/body/
H A Dtext.rs142 pub fn from_bytes(bytes: &'a [u8]) -> Self { in from_bytes() method
462 let _body = TextBody::from_bytes(bytes); in ut_text_body_from_bytes()
498 let mut body = TextBody::from_bytes(bytes); in ut_text_body_from_bytes_syn_data()
534 let mut body = TextBody::from_bytes(bytes); in text_body_from_bytes_asyn_data()
/ohos5.0/foundation/arkui/ui_lite/frameworks/components/
H A Dui_edit_text.cpp239 std::wstring wideText = convert.from_bytes(text); in UpdateTextString()
458 std::wstring wideText = convert.from_bytes(textStr_); in GetTextWidthByCursorIndex()
553 std::wstring wideText = convert.from_bytes(textStr_); in InsertTextByCursorIndex()
554 std::wstring insertWText = convert.from_bytes(text); in InsertTextByCursorIndex()
609 std::wstring wideText = convert.from_bytes(textStr_); in SetCursorIndex()
653 std::wstring wideText = convert.from_bytes(textStr_); in DeleteBackward()
/ohos5.0/foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/
H A Ddb_dfx_adapter.cpp60 … std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(DUMP_LONG_PARAM); in Dump()
62 … std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(DUMP_SHORT_PARAM); in Dump()
/ohos5.0/base/location/services/location_gnss/gnss/source/
H A Dstring_utils.cpp141 return converter.from_bytes(utf8Str); in Utf8ToWstring()
147 return converter.from_bytes(ucs2Str); in Ucs2ToWstring()
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http_client/src/util/config/
H A Dconnector.rs47 let uri = Uri::from_bytes(b"http://127.0.0.1").unwrap(); in ut_connector_config_default()
H A Dsettings.rs600 let uri = Uri::from_bytes(b"http://127.0.0.1:3456").unwrap(); in ut_proxy_clone()
613 let uri = Uri::from_bytes(b"https://127.0.0.1:3456").unwrap(); in ut_proxy_https()
/ohos5.0/drivers/hdf_core/adapter/uhdf2/hdi/test/object_collector/
H A Dobject_collector_test.cpp30 char16_t> {}.from_bytes("sample_driver");
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http_client/src/sync_impl/
H A Dclient.rs545 let body = TextBody::from_bytes(reader.as_bytes()); in ut_request_client_err()
548 *request_uri = Uri::from_bytes(b"http://_:80").unwrap(); in ut_request_client_err()
/ohos5.0/base/hiviewdfx/hitrace/tools/hitrace_converter/
H A Dhitrace_converter.py251 pid = int.from_bytes(one_event["fields"]["common_pid"], byteorder='little')
274 flags = int.from_bytes(one_event["fields"]["common_flags"], byteorder='little')
275 preempt_count = int.from_bytes(one_event["fields"]["common_preempt_count"], byteorder='little')
/ohos5.0/base/telephony/call_manager/services/call/call_state_observer/src/
H A Dreject_call_sms.cpp51 return converter.from_bytes(str); in ConvertToUtf16()
/ohos5.0/foundation/graphic/graphic_2d/rosen/test/2d_engine/unittest/rosen_text/adapter/skia_txt/
H A Dtext_line_base_test.cpp44 std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(text);
H A Drun_test.cpp45 std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(text);
H A Dtypography_create_test.cpp60 std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(text);
/ohos5.0/foundation/communication/ipc/interfaces/innerkits/ipc_core/include/
H A Diremote_object.h30 return std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(str); in to_utf16()
/ohos5.0/foundation/graphic/graphic_2d/rosen/modules/platform/ipc_core/
H A Diremote_object.h30 return std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> {}.from_bytes(str); in to_utf16()

123