Expand description
A crate to help with bit manipulation of integers.
Features
track_calleradds 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
u8values packed as au16.
Constants
- When used as a multiplier, scales a “1 bit”
u8to spread the value across all 8 bits. - When used as a multiplier, scales a “2 bit”
u8to spread the value across all 8 bits. - When used as a multiplier, scales a “4 bit”
u8to 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
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow. - Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow. - Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow. - Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow. - Determines if the
bbit is set inu. - Get the
lowtohighbit region ofu. - Get the
lowtohighbit region ofu, down shifted bylow. - Generates a bit mask where all bits in the region are 1.
- Replicates the lowest
countbits across the entire value. - Replaces the
bbit inu. - Replaces the
lowtohighbit region ofold. - Replaces the
lowtohighbit region ofoldwith an input up shifted bylow.