pub struct SubsetDifference {
pub u_mask_zero_bits: u8,
pub uv: u32,
}Expand description
A parsed Explicit-Subset-Difference entry per Common spec §3.2.5.1.5,
i.e. one row of the Explicit-Subset-Difference Record. The u_mask
is the first byte (number of low-order zero bits in the full
32-bit m_u); uv is the 32-bit uv number itself.
The v_mask is derived from uv per Common spec §3.2.3 (the
while ((uv & ~v_mask) == 0) v_mask <<= 1 C snippet).
Fields§
§u_mask_zero_bits: u8Number of trailing zero bits in the 32-bit m_u mask — i.e.
m_u = 0xFFFFFFFF << u_mask_zero_bits.
uv: u32The 32-bit uv number itself.
Implementations§
Source§impl SubsetDifference
impl SubsetDifference
Sourcepub fn v_mask(&self) -> u32
pub fn v_mask(&self) -> u32
Derive m_v from uv per Common spec §3.2.3 (“the mask for v
is given by the first lower-order 1-bit in the uv number.
That bit, and all lower-order 0-bits, are zero bits in the
‘v’ mask.”). The spec’s reference C code is:
long v_mask = 0xFFFFFFFF;
while ((uv & ~v_mask) == 0) v_mask <<= 1;i.e. the zero region of m_v is trailing_zeros(uv) + 1 bits
wide — the lowest-order 1-bit AND every 0-bit below it.
Trait Implementations§
Source§impl Clone for SubsetDifference
impl Clone for SubsetDifference
Source§fn clone(&self) -> SubsetDifference
fn clone(&self) -> SubsetDifference
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SubsetDifference
Source§impl Debug for SubsetDifference
impl Debug for SubsetDifference
impl Eq for SubsetDifference
Source§impl PartialEq for SubsetDifference
impl PartialEq for SubsetDifference
Source§fn eq(&self, other: &SubsetDifference) -> bool
fn eq(&self, other: &SubsetDifference) -> bool
self and other values to be equal, and is used by ==.