Home
last modified time | relevance | path

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

/linux/rust/kernel/
H A Dstr.rs52 pub const fn from_bytes(bytes: &[u8]) -> &Self {
71 .map(Self::from_bytes)
163 BStr::from_bytes(&self.0[index]) in as_ref()
169 BStr::from_bytes(self)
195 const C: &'static $crate::str::BStr = $crate::str::BStr::from_bytes(S.as_bytes()); in as_char_ptr_in_const_context()
391 BStr::from_bytes(self.to_bytes())
516 let hello_world = BStr::from_bytes(b"hello, world!"); in test_bstr_debug()
518 let escapes = BStr::from_bytes(b"_\t_\n_\r_\\_\'_\"_"); in test_bstr_debug()
520 let others = BStr::from_bytes(b"\x01"); in test_bstr_debug()
522 let non_ascii = BStr::from_bytes( in test_bstr_debug()
39 pub const fn from_bytes(bytes: &[u8]) -> &Self { from_bytes() method
[all...]
/linux/rust/zerocopy/src/
H A Dref.rs311 pub fn from_bytes(source: B) -> Result<Ref<B, T>, CastError<B, T>> { in from_bytes() function
500 Self::from_bytes(source) in from_bytes_with_elems()
552 Self::from_bytes(prefix).map(move |l| (l, bytes)) in from_prefix_with_elems()
605 Self::from_bytes(suffix).map(move |l| (bytes, l)) in from_suffix_with_elems()
1009 let r = Ref::<&mut [u8], u8>::from_bytes(&mut buf).unwrap(); in test_mut_slice_into_ref()
1019 let r = Ref::<_, u8>::from_bytes(&buf[..]).unwrap(); in test_address()
1025 let r = Ref::<_, [u8]>::from_bytes(&buf[..]).unwrap(); in test_address()
1095 test_new_helper(Ref::<_, AU64>::from_bytes(&mut buf.t[..]).unwrap()); in test_new_aligned_sized()
1118 test_new_helper_slice(Ref::<_, [AU64]>::from_bytes(&mut buf.t[..]).unwrap(), 3); in test_new_aligned_sized()
1175 assert!(Ref::<_, AU64>::from_bytes(&buf.t[..]).is_err()); in test_new_error()
[all …]
H A Ddeprecated.rs27 Self::from_bytes(bytes).ok() in new()
72 Self::from_bytes(bytes).ok() in new_unaligned()
119 Self::from_bytes(bytes).ok() in new_slice()
135 Ref::from_bytes(bytes).ok() in new_slice_unaligned()
268 let r: Ref<&[u8], [u8]> = Ref::from_bytes(bytes).unwrap(); in test_deprecated_into_slice()
277 let r: Ref<&mut [u8], [u8]> = Ref::from_bytes(&mut bytes[..]).unwrap(); in test_deprecated_into_mut_slice()
H A Dbyteorder.rs569 pub const fn from_bytes(bytes: [u8; $bytes]) -> $name<O> {
1119 fn from_bytes(bytes: Self::ByteArray) -> Self; in from_bytes() method
1196 fn from_bytes(bytes: [u8; mem::size_of::<$native>()]) -> $name<O> {
1320 const _FROM_BYTES: U16 = U16::from_bytes([0, 1]); in test_const_methods()
1359 let from_bytes = T::from_bytes(bytes); in test_endian() localVariable
1361 from_native.assert_eq_or_nan(from_bytes); in test_endian()
1363 from_bytes.get().assert_eq_or_nan(native); in test_endian()
1366 assert_eq!(from_bytes.into_bytes(), bytes); in test_endian()
1567 let val_be = U16::<BigEndian>::from_bytes([0, 1]); in test_byteorder_traits_coverage()
1568 let val_le = U16::<LittleEndian>::from_bytes([1, 0]); in test_byteorder_traits_coverage()
[all …]
/linux/scripts/crypto/
H A Dgen-hash-testvecs.py54 self.r = int.from_bytes(key[:16], byteorder='little') & rclamp
55 self.s = int.from_bytes(key[16:], byteorder='little')
61 c = int.from_bytes(chunk, byteorder='little') + 2**(8 * len(chunk))
88 return Ghash.reflect_bits_in_bytes(int.from_bytes(data, byteorder='little'))
125 self.h = int.from_bytes(key, byteorder='little')
132 self.acc ^= int.from_bytes(data[i:i+16], byteorder='little')
260 return int.from_bytes(bytestr[pos//8 : pos//8 + length//8], byteorder='little')
/linux/rust/zerocopy-derive/
H A Dlib.rs124 derive!(FromZeros => derive_from_zeros => crate::derive::from_bytes::derive_from_zeros);
125 derive!(FromBytes => derive_from_bytes => crate::derive::from_bytes::derive_from_bytes);
146 (crate::derive::from_bytes::derive_from_bytes, Trait::FromBytes), in most_traits()
/linux/rust/zerocopy-derive/derive/
H A Dfrom_bytes.rs102 let from_bytes = match &ctx.ast.data { in derive_from_bytes() localVariable
108 Ok(IntoIterator::into_iter([from_zeros, from_bytes]).collect()) in derive_from_bytes()
H A Dmod.rs3 pub mod from_bytes; module
/linux/scripts/gdb/linux/
H A Dpgtable.py88 data = int.from_bytes(
/linux/tools/testing/selftests/net/openvswitch/
H A Dovs-dpctl.py1149 lambda x: int.from_bytes(x, "big"),
1156 lambda x: int.from_bytes(x, "big"),
1425 lambda x: int.from_bytes(x, "big"),
1432 lambda x: int.from_bytes(x, "big"),
1469 ("sll", "sll", macstr, lambda x: int.from_bytes(x, "big")),
1470 ("tll", "tll", macstr, lambda x: int.from_bytes(x, "big")),
/linux/tools/testing/selftests/tpm2/
H A Dtpm2.py745 pcrSelect = int.from_bytes(pcrSelect, byteorder='big')