Struct http_srv::server::config::ServerConfig
source · pub struct ServerConfig {
pub port: u16,
pub n_workers: u16,
pub keep_alive_timeout: Duration,
pub keep_alive_requests: u16,
}
Fields§
§port: u16
§n_workers: u16
§keep_alive_timeout: Duration
§keep_alive_requests: u16
Implementations§
source§impl ServerConfig
impl ServerConfig
crate::HttpServer configuration
§Example
use http_srv::server::ServerConfig;
let mut conf =
ServerConfig::default()
.port(8080)
.n_workers(1024);
pub fn keep_alive(&self) -> bool
pub fn n_workers(self, n_workers: u16) -> Self
pub fn port(self, port: u16) -> Self
pub fn keep_alive_timeout(self, timeout: Duration) -> Self
pub fn keep_alive_requests(self, n: u16) -> Self
Trait Implementations§
source§impl Clone for ServerConfig
impl Clone for ServerConfig
source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for ServerConfig
impl Default for ServerConfig
impl Copy 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 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