1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! 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);
//! ```

mod bit_fiddle_macros;