Expand description
A crate to help with bit manipulation of integers.
§Features
track_caller
adds the#[track_caller]
attribute on all the functions that assert stuff.
Structs§
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Iterator for groups of bits in an integer (low to high).
- Two
u8
values packed as au16
.
Constants§
- When used as a multiplier, scales a “1 bit”
u8
to spread the value across all 8 bits. - When used as a multiplier, scales a “2 bit”
u8
to spread the value across all 8 bits. - When used as a multiplier, scales a “4 bit”
u8
to spread the value across all 8 bits.
Functions§
- Splits a byte into 1-bit chunks.
- Splits a byte into 1-bit chunks (reversed).
- Splits a byte into 2-bit chunks.
- Splits a byte into 2-bit chunks (reversed).
- Splits a byte into 4-bit chunks.
- Splits a byte into 4-bit chunks (reversed).
- Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
. - Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
. - Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
. - Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
. - Determines if the
b
bit is set inu
. - Get the
low
tohigh
bit region ofu
. - Get the
low
tohigh
bit region ofu
, down shifted bylow
. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
count
bits across the entire value. - Replaces the
b
bit inu
. - Replaces the
low
tohigh
bit region ofold
. - Replaces the
low
tohigh
bit region ofold
with an input up shifted bylow
.