Home
last modified time | relevance | path

Searched refs:as_bytes (Results 1 – 25 of 531) sorted by relevance

12345678910>>...22

/external/rust/crates/uuid/src/
Dlib.rs295 match self.as_bytes()[8] { in get_variant()
316 (self.as_bytes()[6] >> 4) as usize in get_version_num()
323 let v = self.as_bytes()[6] >> 4; in get_version()
379 let d1 = u32::from(self.as_bytes()[0]) << 24
380 | u32::from(self.as_bytes()[1]) << 16
381 | u32::from(self.as_bytes()[2]) << 8
382 | u32::from(self.as_bytes()[3]);
385 u16::from(self.as_bytes()[4]) << 8 | u16::from(self.as_bytes()[5]);
388 u16::from(self.as_bytes()[6]) << 8 | u16::from(self.as_bytes()[7]);
391 unsafe { &*(self.as_bytes()[8..16].as_ptr() as *const [u8; 8]) };
[all …]
Dv1.rs241 let ticks: u64 = u64::from(self.as_bytes()[6] & 0x0F) << 56 in to_timestamp()
242 | u64::from(self.as_bytes()[7]) << 48 in to_timestamp()
243 | u64::from(self.as_bytes()[4]) << 40 in to_timestamp()
244 | u64::from(self.as_bytes()[5]) << 32 in to_timestamp()
245 | u64::from(self.as_bytes()[0]) << 24 in to_timestamp()
246 | u64::from(self.as_bytes()[1]) << 16 in to_timestamp()
247 | u64::from(self.as_bytes()[2]) << 8 in to_timestamp()
248 | u64::from(self.as_bytes()[3]); in to_timestamp()
250 let counter: u16 = u16::from(self.as_bytes()[8] & 0x3F) << 8 in to_timestamp()
251 | u16::from(self.as_bytes()[9]); in to_timestamp()
/external/rust/crates/bstr/src/
Dext_slice.rs76 fn as_bytes(&self) -> &[u8] { in as_bytes() method
97 fn as_bytes(&self) -> &[u8]; in as_bytes() method
124 BStr::new(self.as_bytes()) in as_bstr()
179 Some(os_str.as_bytes()) in from_os_str()
185 os_str.to_str().map(|s| s.as_bytes()) in from_os_str()
247 utf8::validate(self.as_bytes()).map(|_| { in to_str()
250 unsafe { str::from_utf8_unchecked(self.as_bytes()) } in to_str()
282 str::from_utf8_unchecked(self.as_bytes()) in to_str_unchecked()
347 match utf8::validate(self.as_bytes()) { in to_str_lossy()
352 Cow::Borrowed(str::from_utf8_unchecked(self.as_bytes())) in to_str_lossy()
[all …]
Dext_vec.rs219 Cow::Borrowed(os_str.as_bytes()) in from_os_str_lossy()
226 Cow::Borrowed(x) => Cow::Borrowed(x.as_bytes()), in from_os_str_lossy()
328 .extend_from_slice(ch.encode_utf8(&mut [0; 4]).as_bytes()); in push_char()
759 self.insert_str(at, ch.encode_utf8(&mut [0; 4]).as_bytes()); in insert_char()
984 pub fn as_bytes(&self) -> &[u8] { in as_bytes() method
1054 assert_eq!(s, "foo".as_bytes()); in insert()
1058 assert_eq!(s, "fooa".as_bytes()); in insert()
1062 assert_eq!(s, "afoo".as_bytes()); in insert()
1066 assert_eq!(s, "fooquuxbar".as_bytes()); in insert()
1070 assert_eq!(s, "fooxbar".as_bytes()); in insert()
[all …]
Dimpls.rs7 PartialEq::eq(self.as_bytes(), other)
15 PartialEq::eq(this, other.as_bytes())
28 PartialEq::eq(self.as_bytes(), other)
36 PartialEq::eq(this, self.as_bytes())
48 PartialOrd::partial_cmp(self.as_bytes(), other)
56 PartialOrd::partial_cmp(this, other.as_bytes())
178 BString::from(s.as_bytes().to_vec()) in from()
384 let bytes = self[s..e].as_bytes(); in fmt()
388 for &b in self[s..e].as_bytes() { in fmt()
432 &self.as_bytes()[idx] in index()
[all …]
/external/rust/crates/csv/tests/
Dtests.rs27 let out = cmd_output_with(&mut cmd, SMALLPOP.as_bytes()); in cookbook_read_basic()
34 let out = cmd_output_with(&mut cmd, SMALLPOP.as_bytes()); in cookbook_read_serde()
41 let out = cmd_output_with(&mut cmd, SMALLPOP_COLON.as_bytes()); in cookbook_read_colon()
48 let out = cmd_output_with(&mut cmd, SMALLPOP_NO_HEADERS.as_bytes()); in cookbook_read_no_headers()
69 let out = cmd_output_with(&mut cmd, USPOP.as_bytes()); in tutorial_setup_01()
76 let out = cmd_output_with(&mut cmd, USPOP.as_bytes()); in tutorial_error_01()
88 let out = cmd_output_with(&mut cmd, data.as_bytes()); in tutorial_error_01_errored()
95 let out = cmd_output_with(&mut cmd, USPOP.as_bytes()); in tutorial_error_02()
107 let out = cmd_output_with(&mut cmd, data.as_bytes()); in tutorial_error_02_errored()
114 let out = cmd_output_with(&mut cmd, USPOP.as_bytes()); in tutorial_error_03()
[all …]
/external/rust/cxx/src/
Dcxx_string.rs114 pub fn as_bytes(&self) -> &[u8] { in as_bytes() method
138 str::from_utf8(self.as_bytes()) in to_str()
148 String::from_utf8_lossy(self.as_bytes()) in to_string_lossy()
196 self.push_bytes(s.as_bytes()); in push_str()
219 self.as_bytes() == other.as_bytes() in eq()
225 self.as_bytes() == other.as_bytes() in eq()
231 self.as_bytes() == other.as_bytes() in eq()
239 self.as_bytes().partial_cmp(other.as_bytes()) in partial_cmp()
245 self.as_bytes().cmp(other.as_bytes()) in cmp()
251 self.as_bytes().hash(state); in hash()
/external/rust/crates/clap/src/
Dosstringext.rs10 fn as_bytes(&self) -> &[u8]; in as_bytes() method
96 fn as_bytes(&self) -> &[u8] { in as_bytes() method
97 self.to_str().map(|s| s.as_bytes()).expect(INVALID_UTF8) in as_bytes()
117 self.as_bytes().starts_with(s) in starts_with()
121 for b in self.as_bytes() { in contains_byte()
130 for (i, b) in self.as_bytes().iter().enumerate() { in split_at_byte()
133 OsStr::from_bytes(&self.as_bytes()[..i]), in split_at_byte()
134 OsStr::from_bytes(&self.as_bytes()[i + 1..]), in split_at_byte()
140 OsStr::from_bytes(&self.as_bytes()[self.len()..self.len()]), in split_at_byte()
146 for (i, b) in self.as_bytes().iter().enumerate() { in trim_left_matches()
[all …]
/external/pigweed/pw_bluetooth_hci/
Duart_transport_fuzzer.cc39 stream.Write(std::as_bytes(std::span<const uint16_t>(&opcode, 1))); in LLVMFuzzerTestOneInput()
44 std::as_bytes(std::span<const uint16_t>(&opcode_command_field, 1))); in LLVMFuzzerTestOneInput()
48 std::as_bytes(std::span<const uint8_t>(&opcode_group_field, 1))); in LLVMFuzzerTestOneInput()
59 stream.Write(std::as_bytes( in LLVMFuzzerTestOneInput()
63 stream.Write(std::as_bytes(std::span<const uint16_t>(&handle, 1))); in LLVMFuzzerTestOneInput()
66 stream.Write(std::as_bytes(std::span<const uint8_t>(&pb_flag, 1))); in LLVMFuzzerTestOneInput()
69 stream.Write(std::as_bytes(std::span<const uint8_t>(&bc_flag, 1))); in LLVMFuzzerTestOneInput()
80 stream.Write(std::as_bytes( in LLVMFuzzerTestOneInput()
84 stream.Write(std::as_bytes(std::span<const uint16_t>(&handle, 1))); in LLVMFuzzerTestOneInput()
89 std::as_bytes(std::span<const uint8_t>(&packet_status_flag, 1))); in LLVMFuzzerTestOneInput()
[all …]
/external/rust/crates/macaddr/src/parser/
Dtests.rs18 assert_eq!(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC], addr.as_bytes()); in test_parse_v6_upper_case_canonical_format()
28 assert_eq!(&[0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF], addr.as_bytes()); in test_parse_v6_lower_case_canonical_format()
38 assert_eq!(&[0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF], addr.as_bytes()); in test_parse_v6_mixed_case_canonical_format()
48 assert_eq!(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC], addr.as_bytes()); in test_parse_v6_colon_format()
58 assert_eq!(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC], addr.as_bytes()); in test_parse_v6_cisco_format()
68 assert_eq!(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0], addr.as_bytes()); in test_parse_v8_canonical_format()
78 assert_eq!(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0], addr.as_bytes()); in test_parse_v8_colon_format()
88 assert_eq!(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0], addr.as_bytes()); in test_parse_canonical_format()
98 assert_eq!(&[0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0], addr.as_bytes()); in test_parse_colon_format()
/external/rust/crates/matches/
Dlib.rs109 matches!(bar.as_bytes()[0], b'+' | b'-') && in matches_works()
110 matches!(bar.as_bytes()[1], b'0'...b'9') in matches_works()
118 matches!(bar.as_bytes()[0], b'+' | b'-') && in assert_matches_works()
119 matches!(bar.as_bytes()[1], b'0'...b'9') in assert_matches_works()
128 matches!(bar.as_bytes()[0], b'+' | b'-') && in assert_matches_panics()
129 matches!(bar.as_bytes()[1], b'0'...b'9') in assert_matches_panics()
/external/rust/crates/bstr/src/unicode/
Dword.rs56 pub fn as_bytes(&self) -> &'a [u8] { in as_bytes() method
57 self.0.as_bytes() in as_bytes()
67 if SIMPLE_WORD_FWD.is_match(word.as_bytes()) { in next()
132 pub fn as_bytes(&self) -> &'a [u8] { in as_bytes() method
133 self.0.as_bytes() in as_bytes()
143 if SIMPLE_WORD_FWD.is_match(word.as_bytes()) { in next()
203 pub fn as_bytes(&self) -> &'a [u8] { in as_bytes() method
283 pub fn as_bytes(&self) -> &'a [u8] { in as_bytes() method
329 let got = words(given.as_bytes()); in forward_ucd()
381 assert_eq!(vec!["\u{FEFF}", "Ты"], words("\u{FEFF}Ты".as_bytes())); in forward_additional()
[all …]
/external/tensorflow/tensorflow/python/saved_model/
Dmethod_name_updater_test.py130 compat.as_bytes(self._saved_model_path),
131 compat.as_bytes(constants.SAVED_MODEL_FILENAME_PB))
234 compat.as_bytes(self._saved_model_path),
235 compat.as_bytes(constants.SAVED_MODEL_FILENAME_PBTXT))
250 compat.as_bytes(new_export_dir),
251 compat.as_bytes(constants.SAVED_MODEL_FILENAME_PBTXT))))
350 compat.as_bytes(self._saved_model_path),
351 compat.as_bytes(constants.SAVED_MODEL_FILENAME_PB))
Dmethod_name_updater.py132 compat.as_bytes(self._export_dir),
133 compat.as_bytes(constants.SAVED_MODEL_FILENAME_PBTXT)))
140 compat.as_bytes(new_export_dir),
141 compat.as_bytes(constants.SAVED_MODEL_FILENAME_PBTXT))
145 compat.as_bytes(new_export_dir),
146 compat.as_bytes(constants.SAVED_MODEL_FILENAME_PB))
/external/rust/crates/nix/test/
Dtest_pty.rs199 write(pty.master, string.as_bytes()).unwrap(); in test_openpty()
202 assert_eq!(&buf, string.as_bytes()); in test_openpty()
208 assert_eq!(&buf, echoed_string.as_bytes()); in test_openpty()
213 write(pty.slave, string2.as_bytes()).unwrap(); in test_openpty()
216 assert_eq!(&buf, echoed_string2.as_bytes()); in test_openpty()
248 write(pty.master, string.as_bytes()).unwrap(); in test_openpty_with_termios()
251 assert_eq!(&buf, string.as_bytes()); in test_openpty_with_termios()
256 assert_eq!(&buf, echoed_string.as_bytes()); in test_openpty_with_termios()
261 write(pty.slave, string2.as_bytes()).unwrap(); in test_openpty_with_termios()
264 assert_eq!(&buf, echoed_string2.as_bytes()); in test_openpty_with_termios()
[all …]
Dtest_sendfile.rs72 tmp.write_all(body.as_bytes()).unwrap(); in test_sendfile_freebsd()
75 let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); in test_sendfile_freebsd()
76 let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); in test_sendfile_freebsd()
100 assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); in test_sendfile_freebsd()
119 tmp.write_all(body.as_bytes()).unwrap(); in test_sendfile_darwin()
122 let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); in test_sendfile_darwin()
123 let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); in test_sendfile_darwin()
145 assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); in test_sendfile_darwin()
/external/pigweed/pw_kvs/
Dchecksum_test.cc35 EXPECT_EQ(OkStatus(), algo.Verify(std::as_bytes(std::span(&kStringCrc, 1)))); in TEST()
41 algo.Verify(std::as_bytes(std::span(kString.data(), 2)))); in TEST()
48 algo.Verify(std::as_bytes(std::span(kString.substr(0, 1))))); in TEST()
56 algo.Update(std::as_bytes(std::span(kString))); in TEST()
63 crc_algo.Update(std::as_bytes(std::span(kString))); in TEST()
80 EXPECT_EQ(OkStatus(), checksum.Verify(std::as_bytes(std::span(kString)))); in TEST()
86 checksum.Update(std::as_bytes(std::span(kString))); in TEST()
95 const std::span<const byte> kBytes = std::as_bytes(std::span(kData));
Dkey_value_store_initialized_test.cc132 kvs_.Put("The Key!", std::as_bytes(std::span(value)))); in TEST_F()
141 kvs_.Put("The Key!", std::as_bytes(std::span(value)))); in TEST_F()
192 kvs_.Put("Charles", std::as_bytes(std::span("Mingus")))); in TEST_F()
203 kvs_.Put("Charles", std::as_bytes(std::span("Mingus")))); in TEST_F()
215 kvs_.Put("Charles", std::as_bytes(std::span("Mingus")))); in TEST_F()
227 kvs_.Put("Charles", std::as_bytes(std::span("Mingus")))); in TEST_F()
262 ASSERT_EQ(OkStatus(), kvs_.Put("kEy", std::as_bytes(std::span("123")))); in TEST_F()
270 ASSERT_EQ(OkStatus(), kvs_.Put("kEy", std::as_bytes(std::span("123")))); in TEST_F()
273 EXPECT_EQ(OkStatus(), kvs_.Put("kEy", std::as_bytes(std::span("45678")))); in TEST_F()
283 EXPECT_EQ(OkStatus(), new_kvs.Put("kEy", std::as_bytes(std::span("45678")))); in TEST_F()
[all …]
/external/pigweed/pw_protobuf/
Dstream_decoder_test.cc73 stream::MemoryReader reader(std::as_bytes(std::span(encoded_proto))); in TEST()
153 stream::MemoryReader reader(std::as_bytes(std::span(encoded_proto))); in TEST()
187 stream::MemoryReader wrapped_reader(std::as_bytes(std::span(encoded_proto))); in TEST()
213 stream::MemoryReader reader(std::as_bytes(std::span(encoded_proto))); in TEST()
241 stream::MemoryReader reader(std::as_bytes(std::span(encoded_proto))); in TEST()
276 stream::MemoryReader reader(std::as_bytes(std::span(encoded_proto))); in TEST()
333 stream::MemoryReader reader(std::as_bytes(std::span(encoded_proto))); in TEST()
373 stream::MemoryReader wrapped_reader(std::as_bytes(std::span(encoded_proto))); in TEST()
409 stream::MemoryReader reader(std::as_bytes(std::span(encoded_proto))); in TEST()
441 stream::MemoryReader reader(std::as_bytes(std::span(encoded_proto))); in TEST()
[all …]
Dmap_utils_test.cc84 stream::MemoryReader key_reader(std::as_bytes(std::span{ele.key})); in TEST()
85 stream::MemoryReader value_reader(std::as_bytes(std::span{ele.value})); in TEST()
122 stream::MemoryReader key_reader(std::as_bytes(std::span{key})); in TEST()
123 stream::MemoryReader value_reader(std::as_bytes(std::span{value})); in TEST()
141 stream::MemoryReader key_reader(std::as_bytes(std::span{key})); in TEST()
142 stream::MemoryReader value_reader(std::as_bytes(std::span{value})); in TEST()
Ddecoder_test.cc89 Decoder decoder(std::as_bytes(std::span(encoded_proto))); in TEST()
151 Decoder decoder(std::as_bytes(std::span(encoded_proto))); in TEST()
177 Decoder decoder(std::as_bytes(std::span(encoded_proto))); in TEST()
213 EXPECT_EQ(decoder.Decode(std::as_bytes(std::span(encoded_proto))), in TEST()
240 EXPECT_EQ(decoder.Decode(std::as_bytes(std::span(encoded_proto))), in TEST()
265 EXPECT_EQ(decoder.Decode(std::as_bytes(std::span(encoded_proto))), in TEST()
320 EXPECT_EQ(decoder.Decode(std::as_bytes(std::span(encoded_proto))), in TEST()
370 EXPECT_EQ(decoder.Decode(std::as_bytes(std::span(encoded_proto))), in TEST()
/external/tensorflow/tensorflow/python/data/kernel_tests/
Dlist_files_test.py71 compat.as_bytes(path.join(self.tmp_dir, filename))
86 compat.as_bytes(path.join(self.tmp_dir, filename))
99 compat.as_bytes(path.join(self.tmp_dir, filename))
143 compat.as_bytes(path.join(self.tmp_dir, filename))
157 compat.as_bytes(path.join(self.tmp_dir, filename))
171 compat.as_bytes(path.join(self.tmp_dir, filename))
198 compat.as_bytes(path.join(self.tmp_dir, filename)))
199 actual_filenames.append(compat.as_bytes(self.evaluate(next_element())))
216 compat.as_bytes(path.join(self.tmp_dir, filename))
231 compat.as_bytes(path.join(self.tmp_dir, filename))
/external/rust/crates/base64/src/write/
Dencoder_tests.rs19 assert_eq!(&c.get_ref()[..], encode_config("abc", URL_SAFE).as_bytes()); in encode_three_bytes()
35 encode_config("abcdefghi", URL_SAFE).as_bytes() in encode_nine_bytes_two_writes()
50 assert_eq!(&c.get_ref()[..], encode_config("abc", URL_SAFE).as_bytes()); in encode_one_then_two_bytes()
66 encode_config("abcdef", URL_SAFE).as_bytes() in encode_one_then_five_bytes()
85 encode_config("abcdef", URL_SAFE).as_bytes() in encode_1_2_3_bytes()
99 assert_eq!(&c.get_ref()[..], encode_config("abcd", URL_SAFE).as_bytes()); in encode_with_padding()
117 encode_config("abcdefg", URL_SAFE).as_bytes() in encode_with_padding_multiple_writes()
137 encode_config("abcdefg", URL_SAFE).as_bytes() in finish_writes_extra_byte()
154 encode_config("ab", STANDARD_NO_PAD).as_bytes() in write_partial_chunk_encodes_partial_chunk()
170 encode_config("abc", STANDARD_NO_PAD).as_bytes() in write_1_chunk_encodes_complete_chunk()
[all …]
/external/rust/crates/chrono/src/format/
Dscan.rs16 let mut xs = s.as_bytes().iter().map(|&c| match c { in equals()
20 let mut ys = pattern.as_bytes().iter().cloned(); in equals()
43 let bytes = s.as_bytes(); in number()
106 let buf = s.as_bytes(); in short_month0()
130 let buf = s.as_bytes(); in short_weekday()
182 match s.as_bytes().first() { in char()
226 let b = s.as_bytes(); in timezone_offset_internal()
233 let negative = match s.as_bytes().first() { in timezone_offset_internal()
279 let bytes = s.as_bytes(); in timezone_offset_zulu()
303 match s.as_bytes().first() { in timezone_offset_permissive()
[all …]
/external/pigweed/pw_log/
Dproto_utils.cc44 Status status = encoder.WriteMessage(std::as_bytes(std::span(message))); in EncodeLog()
53 status = encoder.WriteModule(std::as_bytes(std::span(module_name))); in EncodeLog()
56 status = encoder.WriteFile(std::as_bytes(std::span(file_name))); in EncodeLog()
59 status = encoder.WriteThread(std::as_bytes(std::span(thread_name))); in EncodeLog()
85 encoder.WriteModule(std::as_bytes(std::span(&little_endian_module, 1))); in CreateEncoderAndEncodeTokenizedLog()

12345678910>>...22