pub struct StreamAckRanges {
pub stream_id: u64,
pub ack_seq: u64,
pub ranges: Vec<(u64, u64)>,
}Expand description
Receiver → sender positive SACK-range ACK (STREAM_ACK_BATCHING R-1).
Semantics, precisely: ack_seq cumulatively acknowledges every
sequence < ack_seq (identical to StreamWindow::ack_seq — the
receiver’s next_expected). ranges selectively acknowledge
received runs strictly above ack_seq as half-open
[start, end) intervals. ack_seq itself is by definition the
missing head — it is never inside a range, and the cumulative run
is never duplicated as a range. Example: ack_seq = 101,
ranges = [(102, 10001)] ⇒ everything below 101 received, 101
missing, 102..=10000 received.
Wire order is DESCENDING by end (newest first): when the
receiver truncates to MAX_ACK_RANGES it drops the oldest
ranges — the ones the next cumulative advance covers first.
Ranges are fully merged: non-overlapping and non-adjacent.
The sender feeds this to ReliableStream::on_ack_ranges, which
removes SACKed packets from the retransmit window so one lost
head packet no longer RTO-floods everything behind it.
Fields§
§stream_id: u64Stream the ack applies to.
ack_seq: u64Cumulative ack — every sequence < ack_seq is received.
ranges: Vec<(u64, u64)>Received runs strictly above ack_seq: half-open
[start, end), descending by end, merged,
1..=MAX_ACK_RANGES entries.
Implementations§
Source§impl StreamAckRanges
impl StreamAckRanges
Sourcepub const MIN_SIZE: usize
pub const MIN_SIZE: usize
Minimum wire size: header + one range. A rangeless message is
meaningless (the grant’s ack_seq already covers the
contiguous case) and is rejected by Self::decode.
Sourcepub const MAX_SIZE: usize
pub const MAX_SIZE: usize
Maximum wire size (header + MAX_ACK_RANGES ranges).
Sourcepub fn decode(data: &[u8]) -> Result<Self, StreamWindowCodecError>
pub fn decode(data: &[u8]) -> Result<Self, StreamWindowCodecError>
Decode with strict validation. Rejects: truncated / non-16·n
bodies, zero or more than MAX_ACK_RANGES ranges, empty or
inverted ranges, ranges not strictly above ack_seq, and any
ordering that is not strictly-descending / merged (overlap or
adjacency means the producer failed to merge — treat as
malformed rather than guessing).
Trait Implementations§
Source§impl Clone for StreamAckRanges
impl Clone for StreamAckRanges
Source§fn clone(&self) -> StreamAckRanges
fn clone(&self) -> StreamAckRanges
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamAckRanges
impl Debug for StreamAckRanges
impl Eq for StreamAckRanges
Source§impl PartialEq for StreamAckRanges
impl PartialEq for StreamAckRanges
impl StructuralPartialEq for StreamAckRanges
Auto Trait Implementations§
impl Freeze for StreamAckRanges
impl RefUnwindSafe for StreamAckRanges
impl Send for StreamAckRanges
impl Sync for StreamAckRanges
impl Unpin for StreamAckRanges
impl UnsafeUnpin for StreamAckRanges
impl UnwindSafe for StreamAckRanges
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.