Home
last modified time | relevance | path

Searched refs:try_from (Results 1 – 25 of 41) sorted by relevance

12

/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/tests/
H A Dsdv_http_version.rs31 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()
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/
H A Dversion.rs74 fn try_from(str: &'a str) -> Result<Self, Self::Error> { in try_from() method
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("http/2.0").is_err()); in ut_version_try_from()
124 assert!(Version::try_from("http/3.0").is_err()); in ut_version_try_from()
H A Dheaders.rs168 fn try_from(pair: (N, V)) -> Result<Self, Self::Error> { in try_from() function
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() method
279 fn try_from(bytes: &[u8]) -> Result<Self, Self::Error> { in try_from() method
491 fn try_from(value: &str) -> Result<Self, Self::Error> { in try_from() method
509 fn try_from(value: &[u8]) -> Result<Self, Self::Error> { in try_from() method
673 HeaderName::try_from(name) in get()
700 HeaderName::try_from(name) in get_mut()
736 let name = HeaderName::try_from(name).map_err(Into::into)?; in insert()
[all …]
/ohos5.0/base/security/asset/interfaces/inner_kits/c/src/
H A Dlib.rs44 let attr_tag = match Tag::try_from((*attr).tag) { in into_map()
167 match AssetBlob::try_from(&res) { in pre_query_asset()
203 match AssetResultSet::try_from(&res) { in query_asset()
250 fn try_from(vec: &Vec<u8>) -> Result<Self, Self::Error> { in try_from() method
275 fn try_from(value: &Value) -> Result<Self, Self::Error> { in try_from() method
280 Value::Bytes(v) => out.blob = AssetBlob::try_from(v)?, in try_from()
295 fn try_from(map: &AssetMap) -> Result<Self, Self::Error> { in try_from() method
311 (*attr).value = AssetValue::try_from(value)?; in try_from()
328 fn try_from(maps: &Vec<AssetMap>) -> Result<Self, Self::Error> { in try_from() method
341 *result = AssetResult::try_from(map)?; in try_from()
/ohos5.0/base/update/updater/services/rust/hash_signed_data/src/
H A Dhsd.rs33 fn try_from(value: &str) -> Result<Self, Self::Error> { in try_from() method
47 fn try_from(value: &str) -> Result<Self, Self::Error> { in try_from() method
54 hash_signed_data.push(SingleSignedData::try_from(single_hash_data)?); in try_from()
/ohos5.0/base/security/asset/services/common/src/
H A Dprocess_info.rs126 let error = ErrCode::try_from(error as u32)?; in build()
131 let process_info_detail = match OwnerType::try_from(process_info_ffi.owner_type)? { in build()
140 owner_type: OwnerType::try_from(process_info_ffi.owner_type)?, in build()
/ohos5.0/foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/rust/ylong_cloud_extension/src/service_impl/
H A Dtypes.rs140 fn try_from(value: &Database) -> Result<Self, SyncError> { in try_from() method
231 fn try_from(value: &Table) -> Result<Self, Self::Error> { in try_from() method
234 let ipc_fd = ipc_conn::Field::try_from(fd)?; in try_from()
272 fn try_from(value: &Field) -> Result<Self, SyncError> { in try_from() method
276 typ: ipc_conn::FieldType::try_from(value.typ)?, in try_from()
/ohos5.0/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() method
363 fn try_from(s: &'a str) -> Result<Self, Self::Error> { in try_from() method
624 fn try_from(s: &'a str) -> Result<Self, Self::Error> { in try_from() method
625 TryFrom::try_from(s.as_bytes()) in try_from()
738 fn try_from(s: &'a str) -> Result<Self, Self::Error> { in try_from() method
739 TryFrom::try_from(s.as_bytes()) in try_from()
876 fn try_from(s: &'a str) -> Result<Self, Self::Error> { in try_from() method
877 TryFrom::try_from(s.as_bytes()) in try_from()
921 fn try_from(s: &'a [u8]) -> Result<Self, Self::Error> { in try_from() method
929 fn try_from(s: &'a str) -> Result<Self, Self::Error> { in try_from() method
[all …]
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/h3/
H A Doctets.rs55 let bytes: [u8; len] = <[u8; len]>::try_from(self.buf[..len].as_ref()).unwrap(); in into_u8()
71 let bytes: [u8; len] = <[u8; len]>::try_from(self.buf[..len].as_ref()).unwrap(); in into_u16()
87 let bytes: [u8; len] = <[u8; len]>::try_from(self.buf[..len].as_ref()).unwrap(); in into_u32()
103 let bytes: [u8; len] = <[u8; len]>::try_from(self.buf[..len].as_ref()).unwrap(); in into_u64()
/ohos5.0/base/msdp/device_status/rust/ipc/service/src/
H A Didentity.rs67 CommonAction::try_from((code >> ACTIONSHIFT) & ACTIONMASK) in split_action()
73 Intention::try_from((code >> INTENTIONSHIFT) & INTENTIONMASK) in split_intention()
/ohos5.0/base/security/asset/services/crypto_manager/src/
H A Dcrypto.rs84 _ => Err(transfer_error_code(ErrCode::try_from(ret as u32)?)), in init_key()
112 _ => Err(transfer_error_code(ErrCode::try_from(ret as u32)?)), in exec_crypt()
135 _ => Err(transfer_error_code(ErrCode::try_from(ret as u32)?)), in encrypt()
162 _ => Err(transfer_error_code(ErrCode::try_from(ret as u32)?)), in decrypt()
H A Dsecret_key.rs226 _ => Err(transfer_error_code(ErrCode::try_from(ret as u32)?)), in exists()
237 _ => Err(transfer_error_code(ErrCode::try_from(ret as u32)?)), in generate()
248 _ => Err(transfer_error_code(ErrCode::try_from(ret as u32)?)), in delete()
/ohos5.0/base/msdp/device_status/rust/utils/src/
H A Dmacros.rs41 fn try_from(code: u32) -> std::result::Result<Self, Self::Error> {
71 match $name::try_from(val) {
H A Derrors.rs49 fn try_from(value: i32) -> Result<Self, Self::Error> { in try_from() method
/ohos5.0/base/security/asset/frameworks/definition/src/
H A Dmacros.rs43 fn try_from(v: u32) -> std::result::Result<Self, Self::Error> {
91 fn try_from(v: u32) -> std::result::Result<Self, Self::Error> {
H A Dextension.rs110 T::try_from(*num) in get_enum_attr()
/ohos5.0/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() method
180 fn try_from(t: &'a str) -> Result<Self, Self::Error> { in try_from() method
/ohos5.0/foundation/communication/ipc/example/rust_test/client/src/
H A Dmain.rs25 let remote = <dyn ICalc as FromRemoteObj>::try_from(object); in get_calc_service()
/ohos5.0/base/security/asset/services/core_service/src/operations/common/
H A Dargument_check.rs73 if T::try_from(*n).is_err() { in check_enum_variant()
119 match Tag::try_from(*n) { in check_tag_range()
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/h2/
H A Derror.rs112 fn try_from(value: u32) -> Result<Self, Self::Error> { in try_from() method
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http/src/response/
H A Dstatus.rs211 fn try_from(value: u16) -> Result<Self, Self::Error> { in try_from() method
219 fn try_from(value: &'a [u8]) -> Result<Self, Self::Error> { in try_from() method
/ohos5.0/commonlibrary/rust/ylong_http/ylong_http_client/src/util/
H A Dredirect.rs67 .and_then(|str| Uri::try_from(str.as_bytes()).ok()) in redirect()
/ohos5.0/base/msdp/device_status/rust/modules/basic/server/src/
H A Dlib.rs118 match BasicParamID::try_from(id) { in control()
/ohos5.0/base/security/asset/interfaces/inner_kits/rs/src/
H A Dlib.rs116 log_throw_error!(ErrCode::try_from(e)?, "{}", msg) in send_request()

12