#[non_exhaustive]pub struct AckFrequency {
pub ack_eliciting_threshold: u64,
pub max_ack_delay: Option<Duration>,
pub reordering_threshold: u64,
}Expand description
Acknowledgement frequency to request of the peer.
A serializable mirror of quinn’s AckFrequencyConfig, which has private
fields, no getters and no serde support, so it cannot itself appear in a
profile. The three fields are the three knobs that type exposes, and the
Default is hand-written to equal quinn’s own defaults rather than
derived: a derived one would give an ack-eliciting threshold of zero,
which asks the peer to acknowledge every single packet, and a reordering
threshold of zero, which asks it never to acknowledge reordering
promptly. Neither is a sensible starting point, and both would arrive
silently in any file that named one field and left the others out.
With this Default, Some(AckFrequency::default()) means exactly what
Some(AckFrequencyConfig::default()) means in quinn: negotiate the
extension, with its recommended values.
#[non_exhaustive], so outside this crate one is built as
AckFrequency::default() followed by field assignment — the attribute
makes both the struct expression and ..Default::default() illegal
there. Kept rather than dropped because it and the Default above are
one mechanism: this type mirrors an upstream config that gains a knob
from time to time, and the attribute guarantees that every construction
still reachable starts from the hand-written Default. A fourth field
added in a later release therefore arrives carrying quinn’s recommended
value in code that was written before it existed, instead of the zero a
struct expression would have left there — and zero, for both thresholds
here, is a request the peer will honour and nobody meant to make.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ack_eliciting_threshold: u64How many ack-eliciting packets the peer may receive before it must send an acknowledgement.
Zero asks it to acknowledge every one. Defaults to 1, which is quinn’s own default and acknowledges every other packet.
max_ack_delay: Option<Duration>The longest the peer may wait before acknowledging, when the threshold above has not been reached.
None leaves the peer’s own advertised max_ack_delay in place,
which is quinn’s default and is why None is not ambiguous here.
reordering_threshold: u64How far out of order a packet may arrive before the peer must acknowledge immediately.
Zero asks it never to. Defaults to 2, which is quinn’s own default and one below the default packet threshold, as quinn recommends.
Implementations§
Source§impl AckFrequency
impl AckFrequency
Sourcefn validate(&self) -> Result<(), TransportProfileError>
fn validate(&self) -> Result<(), TransportProfileError>
The two varint-valued thresholds, checked against the QUIC varint ceiling before they can fail at connect time.
Field names are reported dotted — ack_frequency.reordering_threshold
— because reordering_threshold on its own would not tell a reader
which part of the file to look at.
Sourcefn to_config(&self) -> Result<AckFrequencyConfig, TransportProfileError>
fn to_config(&self) -> Result<AckFrequencyConfig, TransportProfileError>
Build quinn’s config from this mirror.
Trait Implementations§
Source§impl Clone for AckFrequency
impl Clone for AckFrequency
Source§fn clone(&self) -> AckFrequency
fn clone(&self) -> AckFrequency
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more