Skip to main content

H3Config

Struct H3Config 

Source
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

Source

pub fn builder() -> H3ConfigBuilder

Start building a validated H3Config.

Source

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).

Source

pub fn max_send_bytes(&self) -> u64

Maximum single send_data payload accepted before rejecting with OversizedSend.

Source

pub fn max_recv_bytes(&self) -> usize

Maximum undrained, adapter-buffered received bytes per stream before the receive callback pends.

Source

pub fn max_recv_units(&self) -> usize

Maximum buffered receive units (allocations/messages) per stream.

Trait Implementations§

Source§

impl Clone for H3Config

Source§

fn clone(&self) -> H3Config

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 H3Config

Source§

impl Debug for H3Config

Source§

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

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

impl Default for H3Config

Source§

fn default() -> Self

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

impl Eq for H3Config

Source§

impl PartialEq for H3Config

Source§

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

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.