pub struct H3Config { /* private fields */ }Expand description
Validated, Copy memory-budget configuration threaded from connection /
listener construction into every per-connection and per-stream state.
Fields are private; construct via H3Config::default or
H3Config::builder. All accessors are read-only, so a value cannot be
mutated after construction.
The receive side is enforced per stream as real backpressure (both a byte
budget and a unit-count budget). The send side is only bounded by
max_send_bytes per outstanding send; there is no aggregate send cap, so
per-connection send memory scales as max_send_bytes × concurrent in-flight streams. The adapter cannot enforce an aggregate send budget as
backpressure because the h3 trait contract calls the synchronous
send_data (which copies and takes ownership) before its only async
readiness hook — applications that need to bound send memory should choose
max_send_bytes and cap their concurrent stream count.
Implementations§
Source§impl H3Config
impl H3Config
Sourcepub fn builder() -> H3ConfigBuilder
pub fn builder() -> H3ConfigBuilder
Start building a validated H3Config.
Sourcepub fn try_new(
max_send_bytes: u64,
max_recv_bytes: usize,
max_recv_units: usize,
) -> Result<Self, ConfigError>
pub fn try_new( max_send_bytes: u64, max_recv_bytes: usize, max_recv_units: usize, ) -> Result<Self, ConfigError>
Construct a validated H3Config directly from its three caps.
Returns a ConfigError if any value is out of range (see
H3ConfigBuilder::build).
Sourcepub fn max_send_bytes(&self) -> u64
pub fn max_send_bytes(&self) -> u64
Maximum single send_data payload accepted before rejecting with
OversizedSend.
Sourcepub fn max_recv_bytes(&self) -> usize
pub fn max_recv_bytes(&self) -> usize
Maximum undrained, adapter-buffered received bytes per stream before the receive callback pends.
Sourcepub fn max_recv_units(&self) -> usize
pub fn max_recv_units(&self) -> usize
Maximum buffered receive units (allocations/messages) per stream.