Expand description
Create an unsigned integer with the high/low n bits set to 1
All functions are const
This crate can be particularly useful for creating bit masks
§Features
The inline feature is enabled by default and inlines all the functions
with a suggestion that they should be inline (#[inline])
§Attribution
Original code for setbits_u32_lo taken from:
https://users.rust-lang.org/t/how-to-make-an-integer-with-n-bits-set-without-overflow/63078/3
Functions§
- setbits_
u8_ hi - Create a
u8with the highnbits set to1 - setbits_
u8_ lo - Create a
u8with the lownbits set to1 - setbits_
u16_ hi - Create a
u16with the highnbits set to1 - setbits_
u16_ lo - Create a
u16with the lownbits set to1 - setbits_
u32_ hi - Create a
u32with the highnbits set to1 - setbits_
u32_ lo - Create a
u32with the lownbits set to1 - setbits_
u64_ hi - Create a
u64with the highnbits set to1 - setbits_
u64_ lo - Create a
u64with the lownbits set to1 - setbits_
u128_ hi - Create a
u128with the highnbits set to1 - setbits_
u128_ lo - Create a
u128with the lownbits set to1