Struct cosworth::prelude::server::ServiceConfigBuilder
source · pub struct ServiceConfigBuilder<H> { /* private fields */ }
Expand description
A service config builder
This type can be used to construct an instance of ServiceConfig
through a
builder-like pattern.
Implementations§
source§impl<H> ServiceConfigBuilder<H>
impl<H> ServiceConfigBuilder<H>
sourcepub fn new(handler: H) -> ServiceConfigBuilder<H>
pub fn new(handler: H) -> ServiceConfigBuilder<H>
Create instance of ServiceConfigBuilder
sourcepub fn secure(self) -> ServiceConfigBuilder<H>
pub fn secure(self) -> ServiceConfigBuilder<H>
Enable secure flag for current server.
By default this flag is set to false.
sourcepub fn keep_alive<T>(self, val: T) -> ServiceConfigBuilder<H>where
T: Into<KeepAlive>,
pub fn keep_alive<T>(self, val: T) -> ServiceConfigBuilder<H>where
T: Into<KeepAlive>,
Set server keep-alive setting.
By default keep alive is set to a 5 seconds.
sourcepub fn client_timeout(self, val: u64) -> ServiceConfigBuilder<H>
pub fn client_timeout(self, val: u64) -> ServiceConfigBuilder<H>
Set server client timeout in milliseconds for first request.
Defines a timeout for reading client request header. If a client does not transmit the entire set headers within this time, the request is terminated with the 408 (Request Time-out) error.
To disable timeout set value to 0.
By default client timeout is set to 5000 milliseconds.
sourcepub fn client_shutdown(self, val: u64) -> ServiceConfigBuilder<H>
pub fn client_shutdown(self, val: u64) -> ServiceConfigBuilder<H>
Set server connection shutdown timeout in milliseconds.
Defines a timeout for shutdown connection. If a shutdown procedure does not complete within this time, the request is dropped. This timeout affects only secure connections.
To disable timeout set value to 0.
By default client timeout is set to 5000 milliseconds.
sourcepub fn server_hostname(self, val: &str) -> ServiceConfigBuilder<H>
pub fn server_hostname(self, val: &str) -> ServiceConfigBuilder<H>
Set server host name.
Host name is used by application router aa a hostname for url generation. Check [ConnectionInfo](./dev/struct.ConnectionInfo. html#method.host) documentation for more information.
By default host name is set to a “localhost” value.
sourcepub fn server_address<S>(self, addr: S) -> ServiceConfigBuilder<H>where
S: ToSocketAddrs,
pub fn server_address<S>(self, addr: S) -> ServiceConfigBuilder<H>where
S: ToSocketAddrs,
Set server ip address.
Host name is used by application router aa a hostname for url generation. Check [ConnectionInfo](./dev/struct.ConnectionInfo. html#method.host) documentation for more information.
By default server address is set to a “127.0.0.1:8080”
sourcepub fn finish(self) -> ServiceConfig<H>
pub fn finish(self) -> ServiceConfig<H>
Finish service configuration and create ServiceConfig
object.
Auto Trait Implementations§
impl<H> RefUnwindSafe for ServiceConfigBuilder<H>where
H: RefUnwindSafe,
impl<H> Send for ServiceConfigBuilder<H>where
H: Send,
impl<H> Sync for ServiceConfigBuilder<H>where
H: Sync,
impl<H> Unpin for ServiceConfigBuilder<H>where
H: Unpin,
impl<H> UnwindSafe for ServiceConfigBuilder<H>where
H: UnwindSafe,
Blanket Implementations§
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
&self
to an expression for Diesel’s query builder. Read more