pub struct AckFrame { /* private fields */ }Expand description
ACK Frame
ACK Frame {
Type (i) = 0x02..0x03,
Largest Acknowledged (i),
ACK Delay (i),
ACK Range Count (i),
First ACK Range (i),
ACK Range (..) ...,
[ECN Counts (..)],
}Receiver sends ACK frames (types 0x02 and 0x03) to inform the sender of packets they have received and processed. The ACK frame contains one or more ACK Ranges.
See ack frames of QUIC RFC 9000.
The ACK Range Count is not included in the struct because it is an intermediate variable. It can be obtained from the ranges when writing and is no longer needed after generating the ranges when parsing.
Implementations§
Source§impl AckFrame
impl AckFrame
Sourcepub fn new(
largest: VarInt,
delay: VarInt,
first_range: VarInt,
ranges: Vec<(VarInt, VarInt)>,
ecn: Option<EcnCounts>,
) -> Self
pub fn new( largest: VarInt, delay: VarInt, first_range: VarInt, ranges: Vec<(VarInt, VarInt)>, ecn: Option<EcnCounts>, ) -> Self
Create a new AckFrame.
Sourcepub fn first_range(&self) -> u64
pub fn first_range(&self) -> u64
Return the first range.
Sourcepub fn ecn(&self) -> Option<EcnCounts>
pub fn ecn(&self) -> Option<EcnCounts>
Return the ECN (Explicit Congestion Notification) counter.
Sourcepub fn set_ecn(&mut self, ecn: EcnCounts)
pub fn set_ecn(&mut self, ecn: EcnCounts)
Set the value of the ECN (Explicit Congestion Notification) counter
Sourcepub fn take_ecn(&mut self) -> Option<EcnCounts>
pub fn take_ecn(&mut self) -> Option<EcnCounts>
Take the value of the ECN (Explicit Congestion Notification) counter
Sourcepub fn iter(&self) -> impl Iterator<Item = RangeInclusive<u64>> + '_
pub fn iter(&self) -> impl Iterator<Item = RangeInclusive<u64>> + '_
Iterate through the sequence numbers of the packets acknowledged by the iterative ACK frame, starting from the largest and going down.