pub const fn genmask_u64(range: RangeInclusive<u32>) -> u64
Expand description
Creates a compile-time contiguous bitmask for the given range by performing a compile-time assertion that the range is valid.
This version is the default and should be used if the range is known at compile time.
ยงExamples
assert_eq!(genmask_u64(21..=39), 0x0000_00ff_ffe0_0000);
assert_eq!(genmask_u64(0..=0), 0b1);
assert_eq!(genmask_u64(0..=63), u64::MAX);