Struct tk_http::server::Config
[−]
[src]
pub struct Config { /* fields omitted */ }
Fine-grained configuration of the HTTP server
Methods
impl Config
[src]
fn new() -> Config
Create a config with defaults
fn inflight_request_limit(&mut self, value: usize) -> &mut Self
A number of inflight requests until we stop reading more requests
fn inflight_request_prealoc(&mut self, value: usize) -> &mut Self
Size of the queue that is preallocated for holding requests
Should be smaller than inflight_request_limit
.
fn done(&mut self) -> Arc<Config>
Create a Arc'd config clone to pass to the constructor
This is just a convenience method.
fn first_byte_timeout(&mut self, value: Duration) -> &mut Self
Timeout receiving very first byte over connection
fn keep_alive_timeout(&mut self, value: Duration) -> &mut Self
Timeout of idle connection (when no request has been sent yet)
fn headers_timeout(&mut self, value: Duration) -> &mut Self
Timeout of receiving whole request headers
This timeout starts when first byte of headers is received
fn input_body_byte_timeout(&mut self, value: Duration) -> &mut Self
Maximum delay between any two bytes of input request received
fn input_body_whole_timeout(&mut self, value: Duration) -> &mut Self
Timeout of whole request body received
This timeout might be adjusted on per-request basis in
headers_received
.
fn output_body_byte_timeout(&mut self, value: Duration) -> &mut Self
Maximum delay between any two bytes of the output request could be sent
fn output_body_whole_timeout(&mut self, value: Duration) -> &mut Self
Timeout for the whole response body to be send to the client
This timeout is taken literally for any response, so it must be as large as needed for slowest client fetching slowest file. I.e. it might be as big as a hour or day for some applications, but consider short timeouts if you don't serve large files to prevent DoS attacks.
Trait Implementations
impl Debug for Config
[src]
impl Clone for Config
[src]
fn clone(&self) -> Config
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more