splithex_named_ux!() { /* proc-macro */ }Expand description
Same as splithex_named!, except that the widths of the generated fields are precise
to-the-bit. A dependency on the ux crate is required.
use splitbits::splithex_named_ux;
use ux::{u4, u20};
let (zebras, bees, beavers, fish) = splithex_named_ux!(
0x2F010DB8_85A30000,
"zbbvvvvv ffffffff",
);
assert_eq!(zebras, u4::new(0x2));
assert_eq!(bees, 0xF0u8);
assert_eq!(beavers, u20::new(0x10DB8));
assert_eq!(fish, 0x85A30000u32);