1 unstable release

Uses old Rust 2015

0.1.0 Jun 27, 2018

#11 in #mask

Download history 161/week @ 2024-03-13 177/week @ 2024-03-20 227/week @ 2024-03-27 175/week @ 2024-04-03 121/week @ 2024-04-10 160/week @ 2024-04-17 156/week @ 2024-04-24 161/week @ 2024-05-01 265/week @ 2024-05-08 193/week @ 2024-05-15 278/week @ 2024-05-22 206/week @ 2024-05-29 212/week @ 2024-06-05 158/week @ 2024-06-12 148/week @ 2024-06-19 186/week @ 2024-06-26

725 downloads per month
Used in 2 crates (via radiotap)

Apache-2.0/MIT

7KB

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.


lib.rs:

Miscellaneous bit operations for any Integer.

See the BitOps trait for examples.

Dependencies

~205KB