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() -> RequestConfig
pub async fn new() -> RequestConfig
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 fn from_json<C>(json: C) -> Result<RequestConfig, Error>
pub fn from_json<C>(json: C) -> Result<RequestConfig, Error>
Sourcepub async fn high_security() -> RequestConfig
pub async fn high_security() -> RequestConfig
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) -> &RequestConfig
pub async fn data(&self, data: RequestConfigData) -> &RequestConfig
Sourcepub async fn get_data(&self) -> RequestConfigData
pub async fn get_data(&self) -> RequestConfigData
Sourcepub async fn buffer_size(&self, buffer_size: usize) -> &RequestConfig
pub async fn buffer_size(&self, buffer_size: usize) -> &RequestConfig
Sourcepub async fn max_request_line_length(
&self,
max_request_line_length: usize,
) -> &RequestConfig
pub async fn max_request_line_length( &self, max_request_line_length: usize, ) -> &RequestConfig
Sourcepub async fn max_path_length(&self, max_path_length: usize) -> &RequestConfig
pub async fn max_path_length(&self, max_path_length: usize) -> &RequestConfig
Sourcepub async fn max_query_length(&self, max_query_length: usize) -> &RequestConfig
pub async fn max_query_length(&self, max_query_length: usize) -> &RequestConfig
Sourcepub async fn max_header_line_length(
&self,
max_header_line_length: usize,
) -> &RequestConfig
pub async fn max_header_line_length( &self, max_header_line_length: usize, ) -> &RequestConfig
Sourcepub async fn max_header_count(&self, max_header_count: usize) -> &RequestConfig
pub async fn max_header_count(&self, max_header_count: usize) -> &RequestConfig
Sourcepub async fn max_header_key_length(
&self,
max_header_key_length: usize,
) -> &RequestConfig
pub async fn max_header_key_length( &self, max_header_key_length: usize, ) -> &RequestConfig
Sourcepub async fn max_header_value_length(
&self,
max_header_value_length: usize,
) -> &RequestConfig
pub async fn max_header_value_length( &self, max_header_value_length: usize, ) -> &RequestConfig
Sourcepub async fn max_body_size(&self, max_body_size: usize) -> &RequestConfig
pub async fn max_body_size(&self, max_body_size: usize) -> &RequestConfig
Sourcepub async fn max_ws_frame_size(
&self,
max_ws_frame_size: usize,
) -> &RequestConfig
pub async fn max_ws_frame_size( &self, max_ws_frame_size: usize, ) -> &RequestConfig
Sourcepub async fn max_ws_frames(&self, max_ws_frames: usize) -> &RequestConfig
pub async fn max_ws_frames(&self, max_ws_frames: usize) -> &RequestConfig
Sourcepub async fn http_read_timeout_ms(
&self,
http_read_timeout_ms: u64,
) -> &RequestConfig
pub async fn http_read_timeout_ms( &self, http_read_timeout_ms: u64, ) -> &RequestConfig
Sourcepub async fn ws_read_timeout_ms(
&self,
ws_read_timeout_ms: u64,
) -> &RequestConfig
pub async fn ws_read_timeout_ms( &self, ws_read_timeout_ms: u64, ) -> &RequestConfig
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§fn default() -> RequestConfig
fn default() -> RequestConfig
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.
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§fn from(ctx: RequestConfigData) -> RequestConfig
fn from(ctx: RequestConfigData) -> RequestConfig
Source§impl PartialEq for RequestConfig
Implementation of PartialEq trait for RequestConfig.
impl PartialEq for RequestConfig
Implementation of PartialEq trait for RequestConfig.
Source§fn eq(&self, other: &RequestConfig) -> bool
fn eq(&self, other: &RequestConfig) -> bool
impl Eq for RequestConfig
Implementation of Eq trait for RequestConfig.