setbits 0.1.0

Create an unsigned integer with the high/low `n` bits set to `1`
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented0 out of 10 items with examples
  • Size
  • Source code size: 6.72 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.23 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Oakchris1955/setbits-rs
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Oakchris1955

setbits: Easily and efficiently create bitmasks

CI Status MIT licensed crates.io Documentation Minimum rustc version

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

LICENSE

MIT