pub struct NackPayload {
pub next_expected: u64,
pub missing_bitmap: u64,
}Expand description
NACK payload for reliable streams.
A NACK is sent by the receiver when there is at least one gap in the received-sequence range. It tells the sender:
next_expected: the next sequence the receiver is waiting for. By construction, this sequence is missing (otherwise the receiver would have advanced past it).missing_bitmap: bitiset iff sequencenext_expected + 1 + iis missing (up to 64 future sequences).
Fields§
§next_expected: u64Next sequence the receiver expects. All seqs < next_expected
have been received contiguously.
missing_bitmap: u64Bitmap of missing sequences after next_expected.
Implementations§
Source§impl NackPayload
impl NackPayload
Sourcepub fn from_bytes(data: &[u8]) -> Option<Self>
pub fn from_bytes(data: &[u8]) -> Option<Self>
Parse from bytes. Rejects buffers whose length is anything other
than exactly Self::SIZE so trailing garbage isn’t silently
accepted.
Sourcepub fn missing_sequences(&self) -> impl Iterator<Item = u64> + '_
pub fn missing_sequences(&self) -> impl Iterator<Item = u64> + '_
Get missing sequence numbers.
Emits next_expected (always missing by construction when a NACK
is sent), followed by every future seq whose bit is set in the
missing bitmap.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NackPayload
impl RefUnwindSafe for NackPayload
impl Send for NackPayload
impl Sync for NackPayload
impl Unpin for NackPayload
impl UnsafeUnpin for NackPayload
impl UnwindSafe for NackPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more