Skip to main content

Http2Options

Struct Http2Options 

Source
#[non_exhaustive]
pub struct Http2Options {
Show 22 fields pub adaptive_window: bool, pub initial_stream_id: Option<u32>, pub initial_conn_window_size: u32, pub initial_window_size: u32, pub initial_max_send_streams: usize, pub max_frame_size: Option<u32>, pub keep_alive_interval: Option<Duration>, pub keep_alive_timeout: Duration, pub keep_alive_while_idle: bool, pub max_concurrent_reset_streams: Option<usize>, pub max_send_buffer_size: usize, pub max_concurrent_streams: Option<u32>, pub max_header_list_size: Option<u32>, pub max_pending_accept_reset_streams: Option<usize>, pub enable_push: Option<bool>, pub header_table_size: Option<u32>, pub enable_connect_protocol: Option<bool>, pub no_rfc7540_priorities: Option<bool>, pub headers_pseudo_order: Option<PseudoOrder>, pub headers_stream_dependency: Option<StreamDependency>, pub settings_order: Option<SettingsOrder>, pub priorities: Option<Priorities>,
}
Expand description

Options for tuning HTTP/2 connections.

Http2Options lets you adjust how HTTP/2 works—stream limits, window sizes, frame and header settings, and more. Most fields are optional and have sensible defaults. See each field for details.

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.
§adaptive_window: bool

Whether to use adaptive flow control.

§initial_stream_id: Option<u32>

The initial stream ID for the connection.

§initial_conn_window_size: u32

The initial window size for HTTP/2 connection-level flow control.

§initial_window_size: u32

The initial window size for HTTP/2 streams.

§initial_max_send_streams: usize

The initial maximum number of locally initiated (send) streams.

§max_frame_size: Option<u32>

The maximum frame size to use for HTTP/2.

§keep_alive_interval: Option<Duration>

The interval for HTTP/2 keep-alive ping frames.

§keep_alive_timeout: Duration

The timeout for receiving an acknowledgement of the keep-alive ping.

§keep_alive_while_idle: bool

Whether HTTP/2 keep-alive should apply while the connection is idle.

§max_concurrent_reset_streams: Option<usize>

The maximum number of concurrent locally reset streams.

§max_send_buffer_size: usize

The maximum size of the send buffer for HTTP/2 streams.

§max_concurrent_streams: Option<u32>

The maximum number of concurrent streams initiated by the remote peer.

§max_header_list_size: Option<u32>

The maximum size of the header list.

§max_pending_accept_reset_streams: Option<usize>

The maximum number of pending accept reset streams.

§enable_push: Option<bool>

Whether to enable push promises.

§header_table_size: Option<u32>

The header table size for HPACK compression.

§enable_connect_protocol: Option<bool>

Whether to enable the CONNECT protocol.

§no_rfc7540_priorities: Option<bool>

Whether to disable RFC 7540 Stream Priorities.

§headers_pseudo_order: Option<PseudoOrder>

The HTTP/2 pseudo-header field order for outgoing HEADERS frames.

§headers_stream_dependency: Option<StreamDependency>

The stream dependency for the outgoing HEADERS frame.

§settings_order: Option<SettingsOrder>

The order of settings parameters in the initial SETTINGS frame.

§priorities: Option<Priorities>

The list of PRIORITY frames to be sent after connection establishment.

Implementations§

Source§

impl Http2Options

Source

pub fn builder() -> Http2OptionsBuilder

Creates a new Http2OptionsBuilder instance.

Trait Implementations§

Source§

impl Clone for Http2Options

Source§

fn clone(&self) -> Http2Options

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 Http2Options

Source§

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

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

impl Default for Http2Options

Source§

fn default() -> Self

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

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> Instrument for T

Source§

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

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

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 = 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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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