Home
last modified time | relevance | path

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

12345678910>>...18

/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()
Dv5.rs24 hash.update(namespace.as_bytes()); in new_v5()
133 Uuid::new_v5(&Uuid::NAMESPACE_DNS, "rust-lang.org".as_bytes()); in test_get_version()
142 let uuid = Uuid::new_v5(*ns, name.as_bytes()); in test_hyphenated()
151 let uuid = Uuid::new_v5(*ns, name.as_bytes()); in test_new()
/external/rust/crates/bstr/src/
Dext_slice.rs77 fn as_bytes(&self) -> &[u8] { in as_bytes() method
98 fn as_bytes(&self) -> &[u8]; in as_bytes() method
125 BStr::new(self.as_bytes()) in as_bstr()
180 Some(os_str.as_bytes()) in from_os_str()
186 os_str.to_str().map(|s| s.as_bytes()) in from_os_str()
248 utf8::validate(self.as_bytes()).map(|_| { in to_str()
251 unsafe { str::from_utf8_unchecked(self.as_bytes()) } in to_str()
283 str::from_utf8_unchecked(self.as_bytes()) in to_str_unchecked()
348 match utf8::validate(self.as_bytes()) { in to_str_lossy()
353 Cow::Borrowed(str::from_utf8_unchecked(self.as_bytes())) in to_str_lossy()
[all …]
Dext_vec.rs221 Cow::Borrowed(os_str.as_bytes()) in from_os_str_lossy()
228 Cow::Borrowed(x) => Cow::Borrowed(x.as_bytes()), in from_os_str_lossy()
330 .extend_from_slice(ch.encode_utf8(&mut [0; 4]).as_bytes()); in push_char()
761 self.insert_str(at, ch.encode_utf8(&mut [0; 4]).as_bytes()); in insert_char()
986 pub fn as_bytes(&self) -> &[u8] { in as_bytes() method
1057 assert_eq!(s, "foo".as_bytes()); in insert()
1061 assert_eq!(s, "fooa".as_bytes()); in insert()
1065 assert_eq!(s, "afoo".as_bytes()); in insert()
1069 assert_eq!(s, "fooquuxbar".as_bytes()); in insert()
1073 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()
381 let bytes = self[s..e].as_bytes(); in fmt()
385 for &b in self[s..e].as_bytes() { in fmt()
429 &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.rs110 pub fn as_bytes(&self) -> &[u8] { in as_bytes() method
134 str::from_utf8(self.as_bytes()) in to_str()
144 String::from_utf8_lossy(self.as_bytes()) in to_string_lossy()
149 self.push_bytes(s.as_bytes()); in push_str()
172 self.as_bytes() == other.as_bytes() in eq()
178 self.as_bytes() == other.as_bytes() in eq()
184 self.as_bytes() == other.as_bytes() in eq()
192 self.as_bytes().partial_cmp(other.as_bytes()) in partial_cmp()
198 self.as_bytes().cmp(other.as_bytes()) in cmp()
204 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/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.rs104 matches!(bar.as_bytes()[0], b'+' | b'-') && in matches_works()
105 matches!(bar.as_bytes()[1], b'0'...b'9') in matches_works()
113 matches!(bar.as_bytes()[0], b'+' | b'-') && in assert_matches_works()
114 matches!(bar.as_bytes()[1], b'0'...b'9') in assert_matches_works()
123 matches!(bar.as_bytes()[0], b'+' | b'-') && in assert_matches_panics()
124 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.rs175 write(pty.master, string.as_bytes()).unwrap(); in test_openpty()
178 assert_eq!(&buf, string.as_bytes()); in test_openpty()
184 assert_eq!(&buf, echoed_string.as_bytes()); in test_openpty()
189 write(pty.slave, string2.as_bytes()).unwrap(); in test_openpty()
192 assert_eq!(&buf, echoed_string2.as_bytes()); in test_openpty()
224 write(pty.master, string.as_bytes()).unwrap(); in test_openpty_with_termios()
227 assert_eq!(&buf, string.as_bytes()); in test_openpty_with_termios()
232 assert_eq!(&buf, echoed_string.as_bytes()); in test_openpty_with_termios()
237 write(pty.slave, string2.as_bytes()).unwrap(); in test_openpty_with_termios()
240 assert_eq!(&buf, echoed_string2.as_bytes()); in test_openpty_with_termios()
[all …]
Dtest_sendfile.rs50 tmp.write_all(body.as_bytes()).unwrap(); in test_sendfile_freebsd()
53 let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); in test_sendfile_freebsd()
54 let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); in test_sendfile_freebsd()
78 assert_eq!(bytes_written as usize, expected_string.as_bytes().len()); in test_sendfile_freebsd()
97 tmp.write_all(body.as_bytes()).unwrap(); in test_sendfile_darwin()
100 let headers: Vec<&[u8]> = header_strings.iter().map(|s| s.as_bytes()).collect(); in test_sendfile_darwin()
101 let trailers: Vec<&[u8]> = trailer_strings.iter().map(|s| s.as_bytes()).collect(); in test_sendfile_darwin()
123 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.cc131 kvs_.Put("The Key!", std::as_bytes(std::span(value)))); in TEST_F()
140 kvs_.Put("The Key!", std::as_bytes(std::span(value)))); in TEST_F()
191 kvs_.Put("Charles", std::as_bytes(std::span("Mingus")))); in TEST_F()
202 kvs_.Put("Charles", std::as_bytes(std::span("Mingus")))); in TEST_F()
214 kvs_.Put("Charles", std::as_bytes(std::span("Mingus")))); in TEST_F()
226 kvs_.Put("Charles", std::as_bytes(std::span("Mingus")))); in TEST_F()
261 ASSERT_EQ(OkStatus(), kvs_.Put("kEy", std::as_bytes(std::span("123")))); in TEST_F()
269 ASSERT_EQ(OkStatus(), kvs_.Put("kEy", std::as_bytes(std::span("123")))); in TEST_F()
272 EXPECT_EQ(OkStatus(), kvs_.Put("kEy", std::as_bytes(std::span("45678")))); in TEST_F()
282 EXPECT_EQ(OkStatus(), new_kvs.Put("kEy", std::as_bytes(std::span("45678")))); in TEST_F()
[all …]
/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/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_protobuf/
Dfind_test.cc48 decoder.Decode(std::as_bytes(std::span(encoded_proto))); in TEST()
59 decoder.Decode(std::as_bytes(std::span(encoded_proto))); in TEST()
71 decoder.Decode(std::as_bytes(std::span(encoded_proto))); in TEST()
84 decoder.Decode(std::as_bytes(std::span(encoded_proto))); in TEST()
/external/pdfium/xfa/fxfa/parser/
Dcxfa_document_parser_unittest.cpp44 pdfium::as_bytes(pdfium::make_span(kInput))); in TEST_F()
62 pdfium::as_bytes(pdfium::make_span(kInput))); in TEST_F()
79 pdfium::as_bytes(pdfium::make_span(kInput))); in TEST_F()
96 pdfium::as_bytes(pdfium::make_span(kInput))); in TEST_F()
116 pdfium::as_bytes(pdfium::make_span(kInput))); in TEST_F()
/external/pigweed/pw_checksum/
Dcrc16_ccitt_test.cc51 EXPECT_EQ(Crc16Ccitt::Calculate(std::as_bytes(std::span(kBytes))), in TEST()
56 EXPECT_EQ(Crc16Ccitt::Calculate(std::as_bytes(std::span(kString))), in TEST()
62 crc16.Update(std::as_bytes(std::span(kBytes))); in TEST()
68 crc16.Update(std::as_bytes(std::span(kString))); in TEST()
/external/rust/crates/regex/src/
Dexpand.rs14 match find_byte(b'$', replacement.as_bytes()) { in expand_str()
21 if replacement.as_bytes().get(1).map_or(false, |&b| b == b'$') { in expand_str()
27 let cap_ref = match find_cap_ref(replacement.as_bytes()) { in expand_str()
80 dst.extend(caps.get(i).map(|m| m.as_bytes()).unwrap_or(b"")); in expand_bytes()
84 caps.name(name).map(|m| m.as_bytes()).unwrap_or(b""), in expand_bytes()
201 assert_eq!(None, find_cap_ref($text.as_bytes()));
207 assert_eq!(Some($capref), find_cap_ref($text.as_bytes()));
/external/tensorflow/tensorflow/python/util/
Dcompat.py64 def as_bytes(bytes_or_text, encoding='utf-8'): function
116 return as_bytes(bytes_or_text, encoding)
121 tf_export('compat.as_bytes')(as_bytes)
201 return as_bytes(path)

12345678910>>...18