pub struct ServerConfig {
pub host: String,
pub port: u16,
pub domain: Vec<String>,
pub base_path: String,
pub workers: Option<usize>,
}Fields§
§host: StringInterface to bind, e.g. 0.0.0.0. Empty or * means every interface
and is normalised to 0.0.0.0 on load.
port: u16TCP port.
domain: Vec<String>Only answer requests whose Host: header is one of these. Written as a
single string (domain = "api.example.com") or a list
(domain = ["api.example.com", "www.example.com"]). Unset — or the
catch-all spellings "", * and _ (nginx’s server_name _) —
answers any host, and all of them normalise to an empty list on load.
base_path: StringSub-path the API is mounted under, e.g. /api. Always starts with /
and never ends with one (normalised on load).
workers: Option<usize>Number of worker threads. None = one per CPU.
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl Default for ServerConfig
impl Default for ServerConfig
Source§impl<'de> Deserialize<'de> for ServerConfigwhere
ServerConfig: Default,
impl<'de> Deserialize<'de> for ServerConfigwhere
ServerConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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