Module traits

Source
Expand description

Various traits for performing logic or bitwise operations on numbers.

Traits§

BitAccess
Defines functions that access or modify individual bits in a number.
BitBlockAccess
Defines functions that access or modify blocks of adjacent bits in a number.
BitConvertible
Defines functions that express a number as a Vec of bits or construct a number from an iterator of bits.
BitIterable
Defines an iterator over a value’s bits.
BitScan
Defines functions that search for the next true or false bit in a number, starting at a specified index and searching in the more-significant direction.
CheckedHammingDistance
Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.
CountOnes
Returns the number of ones in the binary representation of a number.
CountZeros
Returns the number of zeros in the binary representation of a number.
HammingDistance
Returns the Hamming distance between two numbers, or the number of bit flips needed to turn one into the other.
LeadingZeros
Returns the number of leading zeros in the binary representation of a number.
LowMask
Returns a number whose least significant $b$ bits are true and whose other bits are false.
NotAssign
Replaces a number with its bitwise negation.
SignificantBits
TrailingZeros
Returns the number of trailing zeros in the binary representation of a number.