pub struct RequestConfig(/* private fields */);Expand description
Thread-safe configuration wrapper for HTTP request parsing.
This struct uses ArcRwLock to provide thread-safe access to RequestConfigData ,
allowing concurrent reads and exclusive writes. It is the public-facing API
for configuring HTTP request parsing limits.
Implementations§
Source§impl RequestConfig
impl RequestConfig
Sourcepub async fn new() -> Self
pub async fn new() -> Self
Creates a new RequestConfig with default secure settings.
This constructor initializes the configuration with standard security limits suitable for most HTTP request parsing scenarios.
§Returns
Self- A newRequestConfiginstance with default settings.
Sourcepub async fn high_security() -> Self
pub async fn high_security() -> Self
Creates a new RequestConfig with high-security settings.
This constructor initializes the configuration with more restrictive limits to provide maximum protection against various attacks in high-risk environments.
§Returns
Self- A newRequestConfiginstance with high-security settings.
Sourcepub async fn data(&self, data: RequestConfigData) -> &Self
pub async fn data(&self, data: RequestConfigData) -> &Self
Sourcepub async fn get_data(&self) -> RequestConfigData
pub async fn get_data(&self) -> RequestConfigData
Sourcepub async fn buffer_size(&self, buffer_size: usize) -> &Self
pub async fn buffer_size(&self, buffer_size: usize) -> &Self
Sourcepub async fn max_request_line_length(
&self,
max_request_line_length: usize,
) -> &Self
pub async fn max_request_line_length( &self, max_request_line_length: usize, ) -> &Self
Sourcepub async fn max_path_length(&self, max_path_length: usize) -> &Self
pub async fn max_path_length(&self, max_path_length: usize) -> &Self
Sourcepub async fn max_query_length(&self, max_query_length: usize) -> &Self
pub async fn max_query_length(&self, max_query_length: usize) -> &Self
Sourcepub async fn max_header_line_length(
&self,
max_header_line_length: usize,
) -> &Self
pub async fn max_header_line_length( &self, max_header_line_length: usize, ) -> &Self
Sourcepub async fn max_header_count(&self, max_header_count: usize) -> &Self
pub async fn max_header_count(&self, max_header_count: usize) -> &Self
Sourcepub async fn max_header_key_length(&self, max_header_key_length: usize) -> &Self
pub async fn max_header_key_length(&self, max_header_key_length: usize) -> &Self
Sourcepub async fn max_header_value_length(
&self,
max_header_value_length: usize,
) -> &Self
pub async fn max_header_value_length( &self, max_header_value_length: usize, ) -> &Self
Sourcepub async fn max_body_size(&self, max_body_size: usize) -> &Self
pub async fn max_body_size(&self, max_body_size: usize) -> &Self
Sourcepub async fn max_ws_frame_size(&self, max_ws_frame_size: usize) -> &Self
pub async fn max_ws_frame_size(&self, max_ws_frame_size: usize) -> &Self
Sourcepub async fn max_ws_frames(&self, max_ws_frames: usize) -> &Self
pub async fn max_ws_frames(&self, max_ws_frames: usize) -> &Self
Sourcepub async fn http_read_timeout_ms(&self, http_read_timeout_ms: u64) -> &Self
pub async fn http_read_timeout_ms(&self, http_read_timeout_ms: u64) -> &Self
Sourcepub async fn ws_read_timeout_ms(&self, ws_read_timeout_ms: u64) -> &Self
pub async fn ws_read_timeout_ms(&self, ws_read_timeout_ms: u64) -> &Self
Trait Implementations§
Source§impl Clone for RequestConfig
impl Clone for RequestConfig
Source§fn clone(&self) -> RequestConfig
fn clone(&self) -> RequestConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequestConfig
impl Debug for RequestConfig
Source§impl Default for RequestConfig
Implementation of Default trait for RequestConfig.
impl Default for RequestConfig
Implementation of Default trait for RequestConfig.
Source§impl Display for RequestConfig
impl Display for RequestConfig
Source§impl From<RequestConfigData> for RequestConfig
Implementation of From trait for RequestConfig.
impl From<RequestConfigData> for RequestConfig
Implementation of From trait for RequestConfig.
Source§impl PartialEq for RequestConfig
Implementation of PartialEq trait for RequestConfig.
impl PartialEq for RequestConfig
Implementation of PartialEq trait for RequestConfig.
impl Eq for RequestConfig
Implementation of Eq trait for RequestConfig.