Skip to main content

Limits

Struct Limits 

Source
pub struct Limits {
Show 15 fields pub max_header_bytes: u64, pub max_concurrent_uni_streams: u32, pub max_concurrent_bidi_streams: u32, pub stream_receive_window: u64, pub connection_receive_window: u64, pub keep_alive: Duration, pub idle_timeout: Duration, pub hello_timeout_ms: u64, pub max_subscriptions: usize, pub subscriber_buffer_bytes: usize, pub max_sequence_scopes: usize, pub max_reorder_hold: usize, pub max_local_streams: usize, pub max_parked_reverse: usize, pub max_dedup_entries: usize,
}
Expand description

Resource limits applied to one connection.

Fields§

§max_header_bytes: u64

Largest frame header this side will accept, in bytes. Checked against the preamble length before any allocation.

§max_concurrent_uni_streams: u32

QUIC concurrent inbound unidirectional streams. Bounds the number of live per-stream parse tasks for one-way transfers.

§max_concurrent_bidi_streams: u32

QUIC concurrent inbound bidirectional streams; bounds live request exchanges per connection and, with max_header_bytes, worst-case header memory.

§stream_receive_window: u64

QUIC per-stream receive window in bytes. Bounds buffered payload for one transfer and provides backpressure to the sender.

§connection_receive_window: u64

QUIC per-connection receive window in bytes.

§keep_alive: Duration

QUIC keep-alive interval. Sent by the dialling side only, so a binding’s value is not used.

§idle_timeout: Duration

QUIC idle timeout, applied in both directions.

§hello_timeout_ms: u64

How long to wait for the peer HELLO before closing the connection with NEGOTIATION_FAILED, in milliseconds.

§max_subscriptions: usize

Subscription filters one peer connection may hold at once, summed over every path. Exceeding it closes the connection with LIMIT_EXCEEDED: SUBSCRIBE has no stream to answer with an ERROR frame.

§subscriber_buffer_bytes: usize

Payload bytes a publisher may hold queued for one subscriber. A message that does not fit is dropped for that subscriber and counted; the publisher never blocks on a slow consumer.

§max_sequence_scopes: usize

Producer scopes — paths and topics — a receiver tracks per connection for gap detection or reassembly, when PerProducer ordering is negotiated. The peer chooses the scope names, so the table needs a ceiling; at the cap a new scope is simply not tracked, no gap is reported for it and nothing is held back for it.

§max_reorder_hold: usize

Transfers a receiver may hold back at once, summed over scopes, when PerProducer(reassemble) ordering is negotiated. A held transfer is an unread stream, so the bytes it pins are quinn’s — up to stream_receive_window for it and connection_receive_window for the hold as a whole. At the cap the oldest held transfer is released out of order with its gap reported, never held in a growing buffer.

§max_local_streams: usize

Live transfers on one local connection, where the OS connection is the stream and there is no multiplexing (decisions/0010 §4.2). Windows caps named-pipe instances at 1-255, which is the tightest platform limit and therefore the one the default respects; an open at the cap waits for a live transfer to end, exactly as a QUIC open waits on the peer’s stream budget, rather than refusing. A peer configured with zero can therefore open nothing and waits until its caller’s deadline, exactly as one granted no QUIC streams.

§max_parked_reverse: usize

Connections a subscriber parks toward a peer it dialled, so that peer can open a stream back (decisions/0012 §4.4). An accepted socket cannot be dialled, so fan-out over a local socket transport rides connections the subscriber opened and left waiting; each is a file descriptor held for a copy that may never come, and each counts against max_local_streams on both sides. A publisher that finds none parked drops that copy and counts it, the same answer fan-out already gives an exhausted subscriber budget. Zero disables the pool, which makes a subscription over such a transport an error at subscribe time rather than a silence.

§max_dedup_entries: usize

Identities a receiver remembers per connection for Bounded deduplication. The window bounds how long an identity is kept, not how many arrive within it, so the count needs its own ceiling; at the cap the oldest entry is evicted, which costs suppression rather than memory.

Implementations§

Source§

impl Limits

Source

pub const fn worst_case_header_memory(&self) -> u64

Worst-case header memory a single hostile connection can pin, in bytes.

Both stream budgets count: a peer may open its full uni and bidi allowance, and every accepted stream starts with one header.

Trait Implementations§

Source§

impl Clone for Limits

Source§

fn clone(&self) -> Self

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 Copy for Limits

Source§

impl Debug for Limits

Source§

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

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

impl Default for Limits

Source§

fn default() -> Self

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

impl Eq for Limits

Source§

impl PartialEq for Limits

Source§

fn eq(&self, other: &Self) -> 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 Limits

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.

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.