Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 18 fields pub header_table_size: u32, pub encoder_table_size: u32, pub max_concurrent_streams: u32, pub initial_window_size: u32, pub connection_window_size: u32, pub window_autotune: bool, pub max_stream_window: u32, pub max_connection_window: u32, pub max_frame_size: u32, pub max_header_list_size: u32, pub max_continuation_frames: u32, pub max_send_buffer: usize, pub settings_timeout_ms: u64, pub graceful_timeout_ms: u64, pub budgets: Budgets, pub enable_connect_protocol: bool, pub keepalive_interval_ms: Option<u64>, pub keepalive_timeout_ms: u64,
}
Expand description

Settings and limits for one side of a connection.

Fields§

§header_table_size: u32

SETTINGS_HEADER_TABLE_SIZE: the HPACK table we let the peer use for our decoder.

§encoder_table_size: u32

Largest HPACK table our encoder keeps, whatever the peer allows.

§max_concurrent_streams: u32

SETTINGS_MAX_CONCURRENT_STREAMS, and the cap on streams whose handler is running.

§initial_window_size: u32

SETTINGS_INITIAL_WINDOW_SIZE: the starting per-stream receive window.

§connection_window_size: u32

The starting connection receive window.

§window_autotune: bool

Grow the receive windows from bandwidth-delay estimates (PING round trips).

§max_stream_window: u32

Per-stream window cap for auto-tuning: the most a stream can have unreleased.

§max_connection_window: u32

Connection window cap for auto-tuning: the most the connection can have unreleased.

§max_frame_size: u32

SETTINGS_MAX_FRAME_SIZE we accept.

§max_header_list_size: u32

SETTINGS_MAX_HEADER_LIST_SIZE, enforced on the decoded list and on the compressed header block across CONTINUATION frames.

§max_continuation_frames: u32

Most CONTINUATION frames in one header block.

§max_send_buffer: usize

Output buffer cap: DATA is accepted only while less than this is waiting to be written, and input processing pauses while twice this is waiting.

§settings_timeout_ms: u64

How long the peer may take to acknowledge our SETTINGS.

§graceful_timeout_ms: u64

Graceful shutdown: how long to wait for the PING that follows the first GOAWAY.

§budgets: Budgets

Frame budgets per sliding window.

§enable_connect_protocol: bool

Server: announce SETTINGS_ENABLE_CONNECT_PROTOCOL and accept extended CONNECT requests with a :protocol pseudo-header (RFC 8441, WebSocket over HTTP/2). Default off; needs the connect-protocol cargo feature (on by default).

§keepalive_interval_ms: Option<u64>

PING keepalive: after this many milliseconds without any frame from the peer, send a PING. None (the default) sends none. Needs the keepalive cargo feature (on by default).

§keepalive_timeout_ms: u64

PING keepalive: close the connection (GOAWAY NO_ERROR, then Event::Closed) when nothing arrives from the peer within this many milliseconds of a keepalive PING. Default 20 s.

Trait Implementations§

Source§

impl Clone for Config

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 Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Forget for Config

§

impl Freeze for Config

§

impl Move for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnsafeUnpin for Config

§

impl UnwindSafe for Config

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.