bitmath_macros

Crates.iobitmath_macros
lib.rsbitmath_macros
version0.0.1
sourcesrc
created_at2022-04-21 02:32:06.463176
updated_at2022-04-21 02:32:06.463176
descriptionUtility proc macros for the bitmath crate
homepage
repositoryhttps://github.com/trashbyte/bitmath_macros
max_upload_size
id571321
size4,589
trashbyte (trashbyte)

documentation

README

bitmath_macros

Contains the utility proc macro bitslice! used with the bitmath crate.

bitslice!()

Allows for taking subsets of Bits objects as a new Bits, with conventional bitwise syntax (e.g. 15:8 instead of 8..16)

let source = Bits::<16>::try_from("00001101 10110000").unwrap();
let middle_bits = bitslice!(source[12:4]);
println!("{}", middle_bits);
// Bits<8>{ 1101 1011 | dec 219/-37 | hex 0xdb/-0x25 }
Commit count: 2

cargo fmt