pub struct Http2Config {
pub enabled: bool,
pub enable_push: bool,
pub max_concurrent_streams: u32,
pub initial_stream_window_size: u32,
pub max_frame_size: u32,
pub enable_connect_protocol: bool,
pub stream_idle_timeout: Duration,
}Expand description
HTTP/2 配置
用于配置 HTTP/2 协议的各项参数。
Fields§
§enabled: bool是否启用 HTTP/2
enable_push: bool是否启用服务器推送
max_concurrent_streams: u32最大并发流数量
initial_stream_window_size: u32初始流窗口大小
max_frame_size: u32最大帧大小
enable_connect_protocol: bool是否启用 CONNECT 协议扩展
stream_idle_timeout: Duration流空闲超时时间
Implementations§
Source§impl Http2Config
impl Http2Config
Sourcepub fn with_enable_push(self, enable: bool) -> Self
pub fn with_enable_push(self, enable: bool) -> Self
设置是否启用服务器推送
Sourcepub fn with_max_concurrent_streams(self, max: u32) -> Self
pub fn with_max_concurrent_streams(self, max: u32) -> Self
设置最大并发流数量
Sourcepub fn with_initial_stream_window_size(self, size: u32) -> Self
pub fn with_initial_stream_window_size(self, size: u32) -> Self
设置初始流窗口大小
Sourcepub fn with_max_frame_size(self, size: u32) -> Self
pub fn with_max_frame_size(self, size: u32) -> Self
设置最大帧大小
Sourcepub fn with_enable_connect_protocol(self, enable: bool) -> Self
pub fn with_enable_connect_protocol(self, enable: bool) -> Self
设置是否启用 CONNECT 协议扩展
Sourcepub fn with_stream_idle_timeout(self, timeout: Duration) -> Self
pub fn with_stream_idle_timeout(self, timeout: Duration) -> Self
设置流空闲超时时间
Trait Implementations§
Source§impl Clone for Http2Config
impl Clone for Http2Config
Source§fn clone(&self) -> Http2Config
fn clone(&self) -> Http2Config
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Http2Config
impl Debug for Http2Config
Auto Trait Implementations§
impl Freeze for Http2Config
impl RefUnwindSafe for Http2Config
impl Send for Http2Config
impl Sync for Http2Config
impl Unpin for Http2Config
impl UnsafeUnpin for Http2Config
impl UnwindSafe for Http2Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more