bit_fiddler

Crates.iobit_fiddler
lib.rsbit_fiddler
version2.1.1
sourcesrc
created_at2020-11-17 16:31:30.992717
updated_at2020-11-21 02:04:08.196914
descriptionMacros for common bit operations with multiple convenient patterns
homepage
repositoryhttps://github.com/MihirLuthra/bit_fiddler
max_upload_size
id313329
size54,358
Mihir Luthra (MihirLuthra)

documentation

https://docs.rs/bit_fiddler

README

bit_fiddler

Crate for common bit operations. Mainly for setting, toggling, unsetting and checking bits.

These operations are provided by macros which accept multiple patterns to allow easy bit fiddling. These include operations on a single bit, range of bits, etc. See macro docs for more details.

Macros in this crate don't do overflow/underflow checks. If invalid args are supplied, behaviour depends on the underlying operators and may panic.

Example

use bit_fiddler::set;

let mut bitmap = 0b_0000_0000;
set!(in bitmap, u8, [3..6]);
assert_eq!(bitmap, 0b_0011_1000);

Documentation is available on https://docs.rs/bit_fiddler

Commit count: 40

cargo fmt