pub struct ServerConfig {
pub port: u16,
pub pool_conf: PoolConfig,
pub keep_alive_timeout: Duration,
pub keep_alive_requests: u16,
pub log_file: Option<String>,
}
Fields§
§port: u16
§pool_conf: PoolConfig
§keep_alive_timeout: Duration
§keep_alive_requests: u16
§log_file: Option<String>
Implementations§
Source§impl ServerConfig
crate::HttpServer
configuration
impl ServerConfig
crate::HttpServer
configuration
§Example
use http_srv::ServerConfig;
use pool::PoolConfig;
let pool_conf = PoolConfig::builder()
.n_workers(120_u16)
.build();
let conf =
ServerConfig::default()
.port(8080)
.pool_config(pool_conf);
Sourcepub fn parse<S: AsRef<str>>(args: &[S]) -> Result<Self>
pub fn parse<S: AsRef<str>>(args: &[S]) -> Result<Self>
Parse the configuration from the command line args
pub fn pool_config(self, conf: PoolConfig) -> 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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ServerConfig
impl Debug 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