Skip to main content

AckFrequency

Struct AckFrequency 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§ack_eliciting_threshold: u64

How 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: u64

How 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

Source

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.

Source

fn to_config(&self) -> Result<AckFrequencyConfig, TransportProfileError>

Build quinn’s config from this mirror.

Trait Implementations§

Source§

impl Clone for AckFrequency

Source§

fn clone(&self) -> AckFrequency

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AckFrequency

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AckFrequency

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for AckFrequency

Source§

impl PartialEq for AckFrequency

Source§

fn eq(&self, other: &AckFrequency) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AckFrequency

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more