pub struct Http2Settings {
pub initial_stream_window_size: u32,
pub initial_connection_window_size: u32,
pub max_frame_size: u32,
pub adaptive_window: bool,
}Available on crate feature
api only.Expand description
HTTP/2 protocol tuning parameters for performance optimization.
Controls flow control windows, frame sizes, and adaptive algorithms to optimize HTTP/2 performance for different use cases from low-latency real-time applications to high-throughput batch processing.
Default Configuration:
- Stream window: 64KB (good for most use cases)
- Connection window: 1MB (allows multiple concurrent streams)
- Frame size: 16KB (HTTP/2 default)
- Adaptive window: Enabled (automatically tunes flow control)
§Performance Profiles
- Low latency: Small windows, disabled adaptive algorithms
- High throughput: Large windows, enabled adaptive algorithms
- Real-time: Minimal buffering, predictable flow control
- Batch processing: Maximum windows for bulk transfers
Fields§
§initial_stream_window_size: u32§initial_connection_window_size: u32§max_frame_size: u32§adaptive_window: boolImplementations§
Source§impl Http2Settings
impl Http2Settings
Sourcepub fn new(
initial_stream_window_size: u32,
initial_connection_window_size: u32,
max_frame_size: u32,
adaptive_window: bool,
) -> Self
pub fn new( initial_stream_window_size: u32, initial_connection_window_size: u32, max_frame_size: u32, adaptive_window: bool, ) -> Self
Create custom HTTP/2 tuning parameters.
§Parameters
initial_stream_window_size: Per-stream buffer size (bytes)initial_connection_window_size: Total connection buffer size (bytes)max_frame_size: Maximum frame size (bytes, 16KB to 16MB)adaptive_window: Enable automatic window size adjustment
Trait Implementations§
Source§impl Debug for Http2Settings
impl Debug for Http2Settings
Auto Trait Implementations§
impl Freeze for Http2Settings
impl RefUnwindSafe for Http2Settings
impl Send for Http2Settings
impl Sync for Http2Settings
impl Unpin for Http2Settings
impl UnwindSafe for Http2Settings
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