bitops 0.1.0

Miscellaneous bit operations for any Integer.
Documentation
  • Coverage
  • 100%
    6 out of 6 items documented5 out of 5 items with examples
  • Size
  • Source code size: 18.08 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 197.30 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • rossmacarthur/bitops
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rossmacarthur

bitops

crates.io docs.rs

Miscellaneous bit operations for any Integer. See documentation here.

Getting started

Add to your project with

cargo add bitops

or directly editing your Cargo.toml

[dependencies]
bitops = "0.1.0"

Example usage

use bitops::BitOps;

let x = 0b1010_1011_0000_1100; // 0xab0c
let flag = 0b1000;

assert!(flag.is_flag());
assert!(flag.is_bit_set(3));

assert!(x.is_flag_set(flag));
assert_eq!(x.bits_as_int(8, 4), 0xb);

License

Licensed under either of

at your option.