pub struct BitArray { /* private fields */ }Expand description
A 128-bit mask, indexed from the most significant bit.
Bit 0 is the most significant bit, matching how FlexFEC packet masks are laid out on the wire:
the first media packet after the base sequence number is the leftmost bit. Upstream keeps this
as a Lo/Hi pair of u64s; a single u128 is the same bits with the seam removed.
Implementations§
Source§impl BitArray
impl BitArray
Sourcepub fn set_bit(&mut self, index: u32)
pub fn set_bit(&mut self, index: u32)
Set the bit at index, counting from the most significant.
Out-of-range indices are ignored rather than panicking: coverage is computed from packet counts that are already bounded, so a stray index means a caller bug, not a packet the mask should silently mis-cover.
Sourcepub fn mask1(&self) -> u16
pub fn mask1(&self) -> u16
The 15-bit mask covering media packets 0..=14 — the one always present on the wire.
Sourcepub fn mask2(&self) -> u32
pub fn mask2(&self) -> u32
The 31-bit mask covering media packets 15..=45, present when the first k-bit is clear.
Sourcepub fn mask3(&self) -> u64
pub fn mask3(&self) -> u64
The 64-bit mask covering media packets 46..=109, as RFC 8627 lays it out.
Sourcepub fn mask3_draft03(&self) -> u64
pub fn mask3_draft03(&self) -> u64
The draft-03 variant of mask3: 63 bits rather than 64.
Draft-03 spends one more bit on the k-flag than the published RFC does, so the third mask is one bit narrower and the whole field shifts down by one. This is the single most consequential difference between the two formats at the bit level, and the reason a draft-03 round trip proves nothing about RFC 8627 conformance.