pub struct ServerConfig {
pub max_connections: usize,
pub max_header_bytes: usize,
pub max_header_count: usize,
pub max_body_bytes: usize,
pub max_response_bytes: usize,
pub request_timeout: Duration,
}Expand description
Resource and deadline limits for the one-shot HTTP server.
Fields§
§max_connections: usizeMaximum number of concurrent accepted connections.
max_header_bytes: usizeMaximum bytes read while parsing one request head.
max_header_count: usizeMaximum request and response header count.
max_body_bytes: usizeMaximum request body size.
max_response_bytes: usizeMaximum logical response size, including the response body.
request_timeout: DurationDeadline for one complete request read or response write.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn new(
max_connections: usize,
max_header_bytes: usize,
max_header_count: usize,
max_body_bytes: usize,
max_response_bytes: usize,
request_timeout: Duration,
) -> Result<Self>
pub fn new( max_connections: usize, max_header_bytes: usize, max_header_count: usize, max_body_bytes: usize, max_response_bytes: usize, request_timeout: Duration, ) -> Result<Self>
Construct and validate a server configuration.
§Errors
Returns io::ErrorKind::InvalidInput when a resource limit is zero,
the header count cannot carry the transport framing fields or exceeds
the parser’s fixed storage, or the deadline is zero.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
impl Copy for ServerConfig
Source§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
impl Eq for ServerConfig
Source§impl PartialEq for ServerConfig
impl PartialEq for ServerConfig
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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