Function pdl_compiler::backends::rust::mask_bits
source · pub fn mask_bits(n: usize, suffix: &str) -> LitIntExpand description
Generate a bit-mask which masks out n least significant bits.
Literal integers in Rust default to the i32 type. For this
reason, if n is larger than 31, a suffix is added to the
LitInt returned. This should either be u64 or usize
depending on where the result is used.