Struct http_srv::server::config::ServerConfig
source · pub struct ServerConfig { /* private fields */ }
Implementations§
source§impl ServerConfig
impl ServerConfig
crate::HttpServer configuration
§Example
use http_server::server::ServerConfig;
let mut conf = ServerConfig::default();
conf.set_port(8080)
.set_n_threads(1024);
pub fn port(&self) -> u16
pub fn n_threads(&self) -> usize
pub fn keep_alive(&self) -> bool
pub fn keep_alive_timeout(&self) -> Duration
pub fn keep_alive_requests(&self) -> u16
pub fn set_port(&mut self, port: u16) -> &mut Self
pub fn set_n_threads(&mut self, n: usize) -> &mut Self
pub fn set_keep_alive_timeout(&mut self, timeout: Duration) -> &mut Self
pub fn set_keep_alive_requests(&mut self, n: u16) -> &mut 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 moreimpl 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