• Home
  • Raw
  • Download

Lines Matching +full:rust +full:- +full:src

3 either [big-endian or little-endian order].
6 byte conversion methods for each type of number in Rust (sans numbers that have
21 Read unsigned 16 bit big-endian integers from a [`Read`] type:
23 ```rust
34 Write unsigned 16 bit little-endian integers to a [`Write`] type:
36 ```rust
54 Note that as of Rust 1.32, the standard numeric types provide built-in methods
58 [big-endian or little-endian order]: https://en.wikipedia.org/wiki/Endianness
66 [`Read`]: https://doc.rust-lang.org/std/io/trait.Read.html
67 [`Write`]: https://doc.rust-lang.org/std/io/trait.Write.html
84 fn extend_sign(val: u64, nbytes: usize) -> i64 { in extend_sign()
85 let shift = (8 - nbytes) * 8; in extend_sign()
90 fn extend_sign128(val: u128, nbytes: usize) -> i128 { in extend_sign128()
91 let shift = (16 - nbytes) * 8; in extend_sign128()
96 fn unextend_sign(val: i64, nbytes: usize) -> u64 { in unextend_sign()
97 let shift = (8 - nbytes) * 8; in unextend_sign()
102 fn unextend_sign128(val: i128, nbytes: usize) -> u128 { in unextend_sign128()
103 let shift = (16 - nbytes) * 8; in unextend_sign128()
108 fn pack_size(n: u64) -> usize { in pack_size()
129 fn pack_size128(n: u128) -> usize { in pack_size128()
188 /// ```rust
198 /// ```rust
202 /// BigEndian::write_i16(&mut buf, -5_000);
203 /// assert_eq!(-5_000, BigEndian::read_i16(&buf));
225 fn read_u16(buf: &[u8]) -> u16; in read_u16()
237 /// ```rust
244 fn read_u24(buf: &[u8]) -> u32 { in read_u24()
258 /// ```rust
265 fn read_u32(buf: &[u8]) -> u32; in read_u32()
277 /// ```rust
284 fn read_u48(buf: &[u8]) -> u64 { in read_u48()
298 /// ```rust
305 fn read_u64(buf: &[u8]) -> u64; in read_u64()
317 /// ```rust
324 fn read_u128(buf: &[u8]) -> u128; in read_u128()
326 /// Reads an unsigned n-bytes integer from `buf`.
335 /// Write and read an n-byte number in little endian order:
337 /// ```rust
344 fn read_uint(buf: &[u8], nbytes: usize) -> u64; in read_uint()
346 /// Reads an unsigned n-bytes integer from `buf`.
355 /// Write and read an n-byte number in little endian order:
357 /// ```rust
364 fn read_uint128(buf: &[u8], nbytes: usize) -> u128; in read_uint128()
376 /// ```rust
395 /// ```rust
416 /// ```rust
435 /// ```rust
456 /// ```rust
475 /// ```rust
493 /// Write and read an n-byte number in little endian order:
495 /// ```rust
513 /// Write and read an n-byte number in little endian order:
515 /// ```rust
534 /// ```rust
538 /// LittleEndian::write_i16(&mut buf, -1_000);
539 /// assert_eq!(-1_000, LittleEndian::read_i16(&buf));
542 fn read_i16(buf: &[u8]) -> i16 { in read_i16()
556 /// ```rust
560 /// LittleEndian::write_i24(&mut buf, -1_000_000);
561 /// assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
564 fn read_i24(buf: &[u8]) -> i32 { in read_i24()
578 /// ```rust
582 /// LittleEndian::write_i32(&mut buf, -1_000_000);
583 /// assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
586 fn read_i32(buf: &[u8]) -> i32 { in read_i32()
600 /// ```rust
604 /// LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
605 /// assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
608 fn read_i48(buf: &[u8]) -> i64 { in read_i48()
622 /// ```rust
626 /// LittleEndian::write_i64(&mut buf, -1_000_000_000);
627 /// assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
630 fn read_i64(buf: &[u8]) -> i64 { in read_i64()
644 /// ```rust
648 /// LittleEndian::write_i128(&mut buf, -1_000_000_000);
649 /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
652 fn read_i128(buf: &[u8]) -> i128 { in read_i128()
656 /// Reads a signed n-bytes integer from `buf`.
665 /// Write and read n-length signed numbers in little endian order:
667 /// ```rust
671 /// LittleEndian::write_int(&mut buf, -1_000, 3);
672 /// assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
675 fn read_int(buf: &[u8], nbytes: usize) -> i64 { in read_int()
679 /// Reads a signed n-bytes integer from `buf`.
688 /// Write and read n-length signed numbers in little endian order:
690 /// ```rust
694 /// LittleEndian::write_int128(&mut buf, -1_000, 3);
695 /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
698 fn read_int128(buf: &[u8], nbytes: usize) -> i128 { in read_int128()
702 /// Reads a IEEE754 single-precision (4 bytes) floating point number.
712 /// ```rust
721 fn read_f32(buf: &[u8]) -> f32 { in read_f32()
725 /// Reads a IEEE754 double-precision (8 bytes) floating point number.
735 /// ```rust
744 fn read_f64(buf: &[u8]) -> f64 { in read_f64()
758 /// ```rust
762 /// LittleEndian::write_i16(&mut buf, -1_000);
763 /// assert_eq!(-1_000, LittleEndian::read_i16(&buf));
780 /// ```rust
784 /// LittleEndian::write_i24(&mut buf, -1_000_000);
785 /// assert_eq!(-1_000_000, LittleEndian::read_i24(&buf));
802 /// ```rust
806 /// LittleEndian::write_i32(&mut buf, -1_000_000);
807 /// assert_eq!(-1_000_000, LittleEndian::read_i32(&buf));
824 /// ```rust
828 /// LittleEndian::write_i48(&mut buf, -1_000_000_000_000);
829 /// assert_eq!(-1_000_000_000_000, LittleEndian::read_i48(&buf));
846 /// ```rust
850 /// LittleEndian::write_i64(&mut buf, -1_000_000_000);
851 /// assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf));
866 /// Write and read n-byte `i128` numbers in little endian order:
868 /// ```rust
872 /// LittleEndian::write_i128(&mut buf, -1_000_000_000);
873 /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf));
889 /// Write and read an n-byte number in little endian order:
891 /// ```rust
895 /// LittleEndian::write_int(&mut buf, -1_000, 3);
896 /// assert_eq!(-1_000, LittleEndian::read_int(&buf, 3));
912 /// Write and read n-length signed numbers in little endian order:
914 /// ```rust
918 /// LittleEndian::write_int128(&mut buf, -1_000, 3);
919 /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3));
926 /// Writes a IEEE754 single-precision (4 bytes) floating point number.
936 /// ```rust
949 /// Writes a IEEE754 double-precision (8 bytes) floating point number.
959 /// ```rust
972 /// Reads unsigned 16 bit integers from `src` into `dst`.
976 /// Panics when `src.len() != 2*dst.len()`.
982 /// ```rust
993 fn read_u16_into(src: &[u8], dst: &mut [u16]); in read_u16_into()
995 /// Reads unsigned 32 bit integers from `src` into `dst`.
999 /// Panics when `src.len() != 4*dst.len()`.
1005 /// ```rust
1016 fn read_u32_into(src: &[u8], dst: &mut [u32]); in read_u32_into()
1018 /// Reads unsigned 64 bit integers from `src` into `dst`.
1022 /// Panics when `src.len() != 8*dst.len()`.
1028 /// ```rust
1039 fn read_u64_into(src: &[u8], dst: &mut [u64]); in read_u64_into()
1041 /// Reads unsigned 128 bit integers from `src` into `dst`.
1045 /// Panics when `src.len() != 16*dst.len()`.
1051 /// ```rust
1062 fn read_u128_into(src: &[u8], dst: &mut [u128]); in read_u128_into()
1064 /// Reads signed 16 bit integers from `src` to `dst`.
1074 /// ```rust
1086 fn read_i16_into(src: &[u8], dst: &mut [i16]) { in read_i16_into()
1090 Self::read_u16_into(src, dst) in read_i16_into()
1093 /// Reads signed 32 bit integers from `src` into `dst`.
1097 /// Panics when `src.len() != 4*dst.len()`.
1103 /// ```rust
1115 fn read_i32_into(src: &[u8], dst: &mut [i32]) { in read_i32_into()
1119 Self::read_u32_into(src, dst); in read_i32_into()
1122 /// Reads signed 64 bit integers from `src` into `dst`.
1126 /// Panics when `src.len() != 8*dst.len()`.
1132 /// ```rust
1144 fn read_i64_into(src: &[u8], dst: &mut [i64]) { in read_i64_into()
1148 Self::read_u64_into(src, dst); in read_i64_into()
1151 /// Reads signed 128 bit integers from `src` into `dst`.
1155 /// Panics when `src.len() != 16*dst.len()`.
1161 /// ```rust
1173 fn read_i128_into(src: &[u8], dst: &mut [i128]) { in read_i128_into()
1177 Self::read_u128_into(src, dst); in read_i128_into()
1180 /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
1181 /// `src` into `dst`.
1185 /// Panics when `src.len() != 4*dst.len()`.
1191 /// ```rust
1195 /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
1203 fn read_f32_into(src: &[u8], dst: &mut [f32]) { in read_f32_into()
1207 Self::read_u32_into(src, dst); in read_f32_into()
1213 /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
1214 /// `src` into `dst`.
1218 /// Panics when `src.len() != 4*dst.len()`.
1224 /// ```rust
1228 /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
1237 fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32]) { in read_f32_into_unchecked()
1238 Self::read_f32_into(src, dst); in read_f32_into_unchecked()
1241 /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
1242 /// `src` into `dst`.
1246 /// Panics when `src.len() != 8*dst.len()`.
1252 /// ```rust
1256 /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
1264 fn read_f64_into(src: &[u8], dst: &mut [f64]) { in read_f64_into()
1268 Self::read_u64_into(src, dst); in read_f64_into()
1275 /// Reads IEEE754 single-precision (4 bytes) floating point numbers from
1276 /// `src` into `dst`.
1280 /// Panics when `src.len() != 8*dst.len()`.
1286 /// ```rust
1290 /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
1299 fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64]) { in read_f64_into_unchecked()
1300 Self::read_f64_into(src, dst); in read_f64_into_unchecked()
1303 /// Writes unsigned 16 bit integers from `src` into `dst`.
1307 /// Panics when `dst.len() != 2*src.len()`.
1313 /// ```rust
1324 fn write_u16_into(src: &[u16], dst: &mut [u8]); in write_u16_into()
1326 /// Writes unsigned 32 bit integers from `src` into `dst`.
1330 /// Panics when `dst.len() != 4*src.len()`.
1336 /// ```rust
1347 fn write_u32_into(src: &[u32], dst: &mut [u8]); in write_u32_into()
1349 /// Writes unsigned 64 bit integers from `src` into `dst`.
1353 /// Panics when `dst.len() != 8*src.len()`.
1359 /// ```rust
1370 fn write_u64_into(src: &[u64], dst: &mut [u8]); in write_u64_into()
1372 /// Writes unsigned 128 bit integers from `src` into `dst`.
1376 /// Panics when `dst.len() != 16*src.len()`.
1382 /// ```rust
1393 fn write_u128_into(src: &[u128], dst: &mut [u8]); in write_u128_into()
1395 /// Writes signed 8 bit integers from `src` into `dst`.
1405 /// Panics when `buf.len() != src.len()`.
1411 /// ```rust
1422 fn write_i8_into(src: &[i8], dst: &mut [u8]) { in write_i8_into()
1423 let src = unsafe { in write_i8_into() localVariable
1424 slice::from_raw_parts(src.as_ptr() as *const u8, src.len()) in write_i8_into()
1426 dst.copy_from_slice(src); in write_i8_into()
1429 /// Writes signed 16 bit integers from `src` into `dst`.
1433 /// Panics when `buf.len() != 2*src.len()`.
1439 /// ```rust
1450 fn write_i16_into(src: &[i16], dst: &mut [u8]) { in write_i16_into()
1451 let src = unsafe { in write_i16_into() localVariable
1452 slice::from_raw_parts(src.as_ptr() as *const u16, src.len()) in write_i16_into()
1454 Self::write_u16_into(src, dst); in write_i16_into()
1457 /// Writes signed 32 bit integers from `src` into `dst`.
1461 /// Panics when `dst.len() != 4*src.len()`.
1467 /// ```rust
1478 fn write_i32_into(src: &[i32], dst: &mut [u8]) { in write_i32_into()
1479 let src = unsafe { in write_i32_into() localVariable
1480 slice::from_raw_parts(src.as_ptr() as *const u32, src.len()) in write_i32_into()
1482 Self::write_u32_into(src, dst); in write_i32_into()
1485 /// Writes signed 64 bit integers from `src` into `dst`.
1489 /// Panics when `dst.len() != 8*src.len()`.
1495 /// ```rust
1506 fn write_i64_into(src: &[i64], dst: &mut [u8]) { in write_i64_into()
1507 let src = unsafe { in write_i64_into() localVariable
1508 slice::from_raw_parts(src.as_ptr() as *const u64, src.len()) in write_i64_into()
1510 Self::write_u64_into(src, dst); in write_i64_into()
1513 /// Writes signed 128 bit integers from `src` into `dst`.
1517 /// Panics when `dst.len() != 16*src.len()`.
1523 /// ```rust
1534 fn write_i128_into(src: &[i128], dst: &mut [u8]) { in write_i128_into()
1535 let src = unsafe { in write_i128_into() localVariable
1536 slice::from_raw_parts(src.as_ptr() as *const u128, src.len()) in write_i128_into()
1538 Self::write_u128_into(src, dst); in write_i128_into()
1541 /// Writes IEEE754 single-precision (4 bytes) floating point numbers from
1542 /// `src` into `dst`.
1546 /// Panics when `src.len() != 4*dst.len()`.
1552 /// ```rust
1556 /// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
1563 fn write_f32_into(src: &[f32], dst: &mut [u8]) { in write_f32_into()
1564 let src = unsafe { in write_f32_into() localVariable
1565 slice::from_raw_parts(src.as_ptr() as *const u32, src.len()) in write_f32_into()
1567 Self::write_u32_into(src, dst); in write_f32_into()
1570 /// Writes IEEE754 double-precision (8 bytes) floating point numbers from
1571 /// `src` into `dst`.
1575 /// Panics when `src.len() != 8*dst.len()`.
1581 /// ```rust
1585 /// let numbers_given = [1.0, 2.0, 31.312e211, -11.32e91];
1592 fn write_f64_into(src: &[f64], dst: &mut [u8]) { in write_f64_into()
1593 let src = unsafe { in write_f64_into() localVariable
1594 slice::from_raw_parts(src.as_ptr() as *const u64, src.len()) in write_f64_into()
1596 Self::write_u64_into(src, dst); in write_f64_into()
1603 /// this is a no-op.
1607 /// Convert the host platform's endianness to big-endian:
1609 /// ```rust
1622 /// this is a no-op.
1626 /// Convert the host platform's endianness to big-endian:
1628 /// ```rust
1641 /// this is a no-op.
1645 /// Convert the host platform's endianness to big-endian:
1647 /// ```rust
1660 /// this is a no-op.
1664 /// Convert the host platform's endianness to big-endian:
1666 /// ```rust
1679 /// this is a no-op.
1683 /// Convert the host platform's endianness to big-endian:
1685 /// ```rust
1693 fn from_slice_i16(src: &mut [i16]) { in from_slice_i16()
1694 let src = unsafe { in from_slice_i16() localVariable
1695 slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u16, src.len()) in from_slice_i16()
1697 Self::from_slice_u16(src); in from_slice_i16()
1704 /// this is a no-op.
1708 /// Convert the host platform's endianness to big-endian:
1710 /// ```rust
1718 fn from_slice_i32(src: &mut [i32]) { in from_slice_i32()
1719 let src = unsafe { in from_slice_i32() localVariable
1720 slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u32, src.len()) in from_slice_i32()
1722 Self::from_slice_u32(src); in from_slice_i32()
1729 /// this is a no-op.
1733 /// Convert the host platform's endianness to big-endian:
1735 /// ```rust
1743 fn from_slice_i64(src: &mut [i64]) { in from_slice_i64()
1744 let src = unsafe { in from_slice_i64() localVariable
1745 slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u64, src.len()) in from_slice_i64()
1747 Self::from_slice_u64(src); in from_slice_i64()
1754 /// this is a no-op.
1758 /// Convert the host platform's endianness to big-endian:
1760 /// ```rust
1768 fn from_slice_i128(src: &mut [i128]) { in from_slice_i128()
1769 let src = unsafe { in from_slice_i128() localVariable
1770 slice::from_raw_parts_mut(src.as_mut_ptr() as *mut u128, src.len()) in from_slice_i128()
1772 Self::from_slice_u128(src); in from_slice_i128()
1775 /// Converts the given slice of IEEE754 single-precision (4 bytes) floating
1779 /// this is a no-op.
1782 /// Converts the given slice of IEEE754 double-precision (8 bytes) floating
1786 /// this is a no-op.
1790 /// Defines big-endian serialization.
1799 /// ```rust
1810 fn default() -> BigEndian { in default()
1820 /// Defines little-endian serialization.
1829 /// ```rust
1840 fn default() -> LittleEndian { in default()
1852 /// Network byte order is defined by [RFC 1700][1] to be big-endian, and is
1865 /// ```rust
1869 /// BigEndian::write_i16(&mut buf, -5_000);
1870 /// assert_eq!(-5_000, NetworkEndian::read_i16(&buf));
1876 /// Defines system native-endian serialization.
1887 /// Defines system native-endian serialization.
1908 // N.B. https://github.com/rust-lang/rust/issues/22776
1915 /// Copies a &[u8] $src into a &mut [<numeric>] $dst for the endianness given
1918 /// This macro is only safe to call when $src and $dst are &[u8] and &mut [u8],
1919 /// respectively. The macro will panic if $src.len() != $size * $dst.len(),
1920 /// where $size represents the size of the integers encoded in $src.
1922 ($src:expr, $dst:expr, $size:expr, $which:ident) => {{
1923 assert_eq!($src.len(), $size * $dst.len());
1927 $src.as_ptr(),
1929 $src.len(),
1938 /// Copies a &[$ty] $src into a &mut [u8] $dst, where $ty must be a numeric
1939 /// type. This panics if size_of::<$ty>() * $src.len() != $dst.len().
1941 /// This macro is only safe to call when $src is a slice of numeric types and
1943 /// $src.
1945 ($src:expr, $dst:expr, $ty:ty) => {{
1947 assert_eq!(size * $src.len(), $dst.len());
1951 $src.as_ptr() as *const u8,
1960 ($src:expr, $dst:expr, $ty:ty, $size:expr, $write:expr) => {{
1962 assert_eq!($size * $src.len(), $dst.len());
1964 for (&n, chunk) in $src.iter().zip($dst.chunks_mut($size)) {
1972 fn read_u16(buf: &[u8]) -> u16 { in read_u16()
1977 fn read_u32(buf: &[u8]) -> u32 { in read_u32()
1982 fn read_u64(buf: &[u8]) -> u64 { in read_u64()
1987 fn read_u128(buf: &[u8]) -> u128 { in read_u128()
1992 fn read_uint(buf: &[u8], nbytes: usize) -> u64 { in read_uint()
1999 ptr_out.offset((8 - nbytes) as isize), in read_uint()
2007 fn read_uint128(buf: &[u8], nbytes: usize) -> u128 { in read_uint128()
2014 ptr_out.offset((16 - nbytes) as isize), in read_uint128()
2048 bytes.as_ptr().offset((8 - nbytes) as isize), in write_uint()
2062 bytes.as_ptr().offset((16 - nbytes) as isize), in write_uint128()
2070 fn read_u16_into(src: &[u8], dst: &mut [u16]) { in read_u16_into()
2071 unsafe_read_slice!(src, dst, 2, to_be); in read_u16_into()
2075 fn read_u32_into(src: &[u8], dst: &mut [u32]) { in read_u32_into()
2076 unsafe_read_slice!(src, dst, 4, to_be); in read_u32_into()
2080 fn read_u64_into(src: &[u8], dst: &mut [u64]) { in read_u64_into()
2081 unsafe_read_slice!(src, dst, 8, to_be); in read_u64_into()
2085 fn read_u128_into(src: &[u8], dst: &mut [u128]) { in read_u128_into()
2086 unsafe_read_slice!(src, dst, 16, to_be); in read_u128_into()
2090 fn write_u16_into(src: &[u16], dst: &mut [u8]) { in write_u16_into()
2092 unsafe_write_slice_native!(src, dst, u16); in write_u16_into()
2094 write_slice!(src, dst, u16, 2, Self::write_u16); in write_u16_into()
2099 fn write_u32_into(src: &[u32], dst: &mut [u8]) { in write_u32_into()
2101 unsafe_write_slice_native!(src, dst, u32); in write_u32_into()
2103 write_slice!(src, dst, u32, 4, Self::write_u32); in write_u32_into()
2108 fn write_u64_into(src: &[u64], dst: &mut [u8]) { in write_u64_into()
2110 unsafe_write_slice_native!(src, dst, u64); in write_u64_into()
2112 write_slice!(src, dst, u64, 8, Self::write_u64); in write_u64_into()
2117 fn write_u128_into(src: &[u128], dst: &mut [u8]) { in write_u128_into()
2119 unsafe_write_slice_native!(src, dst, u128); in write_u128_into()
2121 write_slice!(src, dst, u128, 16, Self::write_u128); in write_u128_into()
2188 fn read_u16(buf: &[u8]) -> u16 { in read_u16()
2193 fn read_u32(buf: &[u8]) -> u32 { in read_u32()
2198 fn read_u64(buf: &[u8]) -> u64 { in read_u64()
2203 fn read_u128(buf: &[u8]) -> u128 { in read_u128()
2208 fn read_uint(buf: &[u8], nbytes: usize) -> u64 { in read_uint()
2219 fn read_uint128(buf: &[u8], nbytes: usize) -> u128 { in read_uint128()
2270 fn read_u16_into(src: &[u8], dst: &mut [u16]) { in read_u16_into()
2271 unsafe_read_slice!(src, dst, 2, to_le); in read_u16_into()
2275 fn read_u32_into(src: &[u8], dst: &mut [u32]) { in read_u32_into()
2276 unsafe_read_slice!(src, dst, 4, to_le); in read_u32_into()
2280 fn read_u64_into(src: &[u8], dst: &mut [u64]) { in read_u64_into()
2281 unsafe_read_slice!(src, dst, 8, to_le); in read_u64_into()
2285 fn read_u128_into(src: &[u8], dst: &mut [u128]) { in read_u128_into()
2286 unsafe_read_slice!(src, dst, 16, to_le); in read_u128_into()
2290 fn write_u16_into(src: &[u16], dst: &mut [u8]) { in write_u16_into()
2292 unsafe_write_slice_native!(src, dst, u16); in write_u16_into()
2294 write_slice!(src, dst, u16, 2, Self::write_u16); in write_u16_into()
2299 fn write_u32_into(src: &[u32], dst: &mut [u8]) { in write_u32_into()
2301 unsafe_write_slice_native!(src, dst, u32); in write_u32_into()
2303 write_slice!(src, dst, u32, 4, Self::write_u32); in write_u32_into()
2308 fn write_u64_into(src: &[u64], dst: &mut [u8]) { in write_u64_into()
2310 unsafe_write_slice_native!(src, dst, u64); in write_u64_into()
2312 write_slice!(src, dst, u64, 8, Self::write_u64); in write_u64_into()
2317 fn write_u128_into(src: &[u128], dst: &mut [u8]) { in write_u128_into()
2319 unsafe_write_slice_native!(src, dst, u128); in write_u128_into()
2321 write_slice!(src, dst, u128, 16, Self::write_u128); in write_u128_into()
2404 ($max - 1) >> (8 * ($maxbytes - $bytes))
2412 pub fn clone(&self) -> T { in clone()
2418 fn eq(&self, other: &T) -> bool { in eq()
2424 fn arbitrary<G: Gen>(gen: &mut G) -> Wi128<u128> { in arbitrary()
2428 Wi128(output & (max - 1)) in arbitrary()
2433 fn arbitrary<G: Gen>(gen: &mut G) -> Wi128<i128> { in arbitrary()
2437 Wi128(output & (max - 1)) in arbitrary()
2461 fn prop(n: $ty_int) -> bool {
2466 qc_sized(prop as fn($ty_int) -> bool, $max);
2471 fn prop(n: $ty_int) -> bool {
2476 qc_sized(prop as fn($ty_int) -> bool, $max);
2481 fn prop(n: $ty_int) -> bool {
2486 qc_sized(prop as fn($ty_int) -> bool, $max);
2502 fn prop(n: $ty_int) -> bool {
2505 BigEndian::$write(&mut buf[16 - bytes..], n.clone());
2506 n == BigEndian::$read(&buf[16 - bytes..])
2508 qc_sized(prop as fn($ty_int) -> bool, $max - 1);
2513 fn prop(n: $ty_int) -> bool {
2519 qc_sized(prop as fn($ty_int) -> bool, $max - 1);
2524 fn prop(n: $ty_int) -> bool {
2530 qc_sized(prop as fn($ty_int) -> bool, $max - 1);
3401 ($max - 1) >> (8 * (8 - $bytes))
3419 fn prop(n: $ty_int) -> bool {
3422 let offset = wtr.len() - $bytes;
3426 qc_sized(prop as fn($ty_int) -> bool, $max);
3431 fn prop(n: $ty_int) -> bool {
3437 qc_sized(prop as fn($ty_int) -> bool, $max);
3442 fn prop(n: $ty_int) -> bool {
3446 wtr.len() - $bytes
3453 qc_sized(prop as fn($ty_int) -> bool, $max);
3469 fn prop(n: $ty_int) -> bool {
3475 qc_sized(prop as fn($ty_int) -> bool, $max - 1);
3480 fn prop(n: $ty_int) -> bool {
3486 qc_sized(prop as fn($ty_int) -> bool, $max - 1);
3491 fn prop(n: $ty_int) -> bool {
3497 qc_sized(prop as fn($ty_int) -> bool, $max - 1);
3966 fn prop(numbers: Vec<$ty_int>) -> bool {
3981 qc_unsized(prop as fn(_) -> bool);
3987 fn prop(numbers: Vec<$ty_int>) -> bool {
4002 qc_unsized(prop as fn(_) -> bool);
4008 fn prop(numbers: Vec<$ty_int>) -> bool {
4023 qc_unsized(prop as fn(_) -> bool);