pub struct Bits { /* private fields */ }Expand description
Which bits of a value are known, and what they are.
A set bit in unknown means that bit could be either. A clear one means value has it. The
two are kept canonical, so a bit that is unknown is zero in value, which makes equality mean
what it looks like.
Implementations§
Source§impl Bits
impl Bits
Sourcepub const fn min(self) -> u128
pub const fn min(self) -> u128
The smallest value these bits allow, which is the unknown ones all zero.
Sourcepub const fn from_parts(value: u128, unknown: u128, width: u32) -> Self
pub const fn from_parts(value: u128, unknown: u128, width: u32) -> Self
Bits from a value and a mask of which of them mean nothing.
This is the way in for an operation that worked out its answer a bit at a time, which is every bitwise operation. The value is canonicalized, so a bit that is unknown comes back zero however it went in.
Sourcepub const fn unknown_bits(self) -> u128
pub const fn unknown_bits(self) -> u128
The bits that mean nothing, as a mask.
Sourcepub const fn low_zeros(self) -> u32
pub const fn low_zeros(self) -> u32
How many low bits are known to be zero, which is what says a value is a multiple of a power of two and so what an alignment fact is made of.