pub const fn u32_get_region(low: u32, high: u32, u: u32) -> u32Expand description
Get the low to high bit region of u.
The low and high values form an inclusive bit range.
§Panics
lowandhighcan’t exceed the number of bits in the type.lowmust be less thanhigh.
assert_eq!(u32_get_region(0, 2, u32::MAX), 0b0000_0111_u32);
assert_eq!(u32_get_region(1, 3, u32::MAX), 0b0000_1110_u32);
assert_eq!(u32_get_region(4, 7, u32::MAX), 0b1111_0000_u32);