pub struct CompressionConfig {
pub server_max_window_bits: u8,
pub client_max_window_bits: u8,
pub server_no_context_takeover: bool,
pub client_no_context_takeover: bool,
}Expand description
压缩配置,对应 permessage-deflate 扩展参数
Fields§
§server_max_window_bits: u8服务端窗口大小指数(4-15,对应 2^server_no_context_takeover_bits)
client_max_window_bits: u8客户端窗口大小指数(4-15)
server_no_context_takeover: bool服务端不保留上下文(每条消息独立压缩)
client_no_context_takeover: bool客户端不保留上下文
Implementations§
Source§impl CompressionConfig
impl CompressionConfig
Sourcepub fn with_server_window_bits(self, bits: u8) -> Self
pub fn with_server_window_bits(self, bits: u8) -> Self
设置服务端窗口大小
Sourcepub fn with_client_window_bits(self, bits: u8) -> Self
pub fn with_client_window_bits(self, bits: u8) -> Self
设置客户端窗口大小
Sourcepub fn with_server_no_context_takeover(self) -> Self
pub fn with_server_no_context_takeover(self) -> Self
启用服务端无上下文接管
Sourcepub fn with_client_no_context_takeover(self) -> Self
pub fn with_client_no_context_takeover(self) -> Self
启用客户端无上下文接管
Sourcepub fn to_extension_params(&self) -> String
pub fn to_extension_params(&self) -> String
将配置渲染为 permessage-deflate 扩展参数字符串
Trait Implementations§
Source§impl Clone for CompressionConfig
impl Clone for CompressionConfig
Source§fn clone(&self) -> CompressionConfig
fn clone(&self) -> CompressionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CompressionConfig
impl Debug for CompressionConfig
Auto Trait Implementations§
impl Freeze for CompressionConfig
impl RefUnwindSafe for CompressionConfig
impl Send for CompressionConfig
impl Sync for CompressionConfig
impl Unpin for CompressionConfig
impl UnsafeUnpin for CompressionConfig
impl UnwindSafe for CompressionConfig
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