Struct witchcraft_server::config::install::ServerConfig
source · [−]pub struct ServerConfig { /* private fields */ }Expand description
Advanced server configuration.
Implementations
sourceimpl ServerConfig
impl ServerConfig
sourcepub fn processors(&self) -> usize
pub fn processors(&self) -> usize
Returns the number of processors the server is allocated.
This is only used to derive default values for other settings in this type.
Defaults to the number of logical CPUs.
sourcepub fn min_threads(&self) -> usize
pub fn min_threads(&self) -> usize
Returns the minimum number of threads in the pool used to process blocking endpoints.
Defaults to 8 times the number of processors.
sourcepub fn max_threads(&self) -> usize
pub fn max_threads(&self) -> usize
Returns the maximum number of threads in the pool used to process blocking endpoints.
Defaults to the maximum of 32 times the number of processors and 256.
sourcepub fn max_connections(&self) -> usize
pub fn max_connections(&self) -> usize
Returns the maximum number of live TCP connections the server will allow at any time.
Defaults to 10 times the value of Self::max_threads.
sourcepub fn io_threads(&self) -> usize
pub fn io_threads(&self) -> usize
Returns the number of threads used for nonblocking operations in the server’s Tokio runtime.
Defaults to half the number of processors.
sourcepub fn idle_thread_timeout(&self) -> Duration
pub fn idle_thread_timeout(&self) -> Duration
Returns the amount of time a thread in the blocking request pool will sit idle before shutting down.
Defaults to 5 minutes.
sourcepub fn shutdown_timeout(&self) -> Duration
pub fn shutdown_timeout(&self) -> Duration
Returns the amount of time the server will wait for pending requests to complete when shutting down.
Defaults to 15 seconds.
sourcepub fn gzip(&self) -> bool
pub fn gzip(&self) -> bool
Determines if responses larger than 1 MiB will be compressed with gzip.
Defaults to true.
sourcepub fn http2(&self) -> bool
pub fn http2(&self) -> bool
Determines if the server will support the HTTP2 protocol.
Defaults to false.
sourcepub fn idle_connection_timeout(&self) -> Option<Duration>
pub fn idle_connection_timeout(&self) -> Option<Duration>
Returns the amount of time the server allows TCP connections to remain idle before shutting them down.
If None, defaults to 1 minute. If Some, the time will be included in HTTP responses in a Keep-Alive
header.
sourceimpl ServerConfig
impl ServerConfig
sourcepub fn builder() -> BuilderFinal
pub fn builder() -> BuilderFinal
Returns a new builder.
Trait Implementations
sourceimpl Clone for ServerConfig
impl Clone for ServerConfig
sourcefn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ServerConfig
impl Debug for ServerConfig
sourceimpl Default for ServerConfig
impl Default for ServerConfig
sourcefn default() -> ServerConfig
fn default() -> ServerConfig
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
sourcefn deserialize<D>(
deserializer: D
) -> Result<ServerConfig, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<ServerConfig, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<ServerConfig> for ServerConfig
impl PartialEq<ServerConfig> for ServerConfig
sourcefn eq(&self, other: &ServerConfig) -> bool
fn eq(&self, other: &ServerConfig) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ServerConfig) -> bool
fn ne(&self, other: &ServerConfig) -> bool
This method tests for !=.
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more