pub struct ServiceConfig(/* private fields */);
Expand description
HTTP service configuration.
Implementations§
Source§impl ServiceConfig
impl ServiceConfig
Sourcepub fn new(
keep_alive: KeepAlive,
client_request_timeout: Duration,
client_disconnect_timeout: Duration,
secure: bool,
local_addr: Option<SocketAddr>,
) -> ServiceConfig
pub fn new( keep_alive: KeepAlive, client_request_timeout: Duration, client_disconnect_timeout: Duration, secure: bool, local_addr: Option<SocketAddr>, ) -> ServiceConfig
Create instance of ServiceConfig
.
Sourcepub fn local_addr(&self) -> Option<SocketAddr>
pub fn local_addr(&self) -> Option<SocketAddr>
Returns the local address that this server is bound to.
Returns None
for connections via UDS (Unix Domain Socket).
Sourcepub fn keep_alive(&self) -> KeepAlive
pub fn keep_alive(&self) -> KeepAlive
Connection keep-alive setting.
Sourcepub fn keep_alive_deadline(&self) -> Option<Instant>
pub fn keep_alive_deadline(&self) -> Option<Instant>
Creates a time object representing the deadline for this connection’s keep-alive period, if enabled.
When KeepAlive::Os
or KeepAlive::Disabled
is set, this will return None
.
Sourcepub fn client_request_deadline(&self) -> Option<Instant>
pub fn client_request_deadline(&self) -> Option<Instant>
Creates a time object representing the deadline for the client to finish sending the head of its first request.
Returns None
if this ServiceConfig was
constructed with client_request_timeout: 0
.
Sourcepub fn client_disconnect_deadline(&self) -> Option<Instant>
pub fn client_disconnect_deadline(&self) -> Option<Instant>
Creates a time object representing the deadline for the client to disconnect.
Sourcepub fn h1_allow_half_closed(&self) -> bool
pub fn h1_allow_half_closed(&self) -> bool
Whether HTTP/1 connections should support half-closures.
Clients can choose to shutdown their writer-side of the connection after completing their
request and while waiting for the server response. If this configuration is false
, the
server will abort the connection handling as soon as it detects an EOF from the client
Trait Implementations§
Source§impl Clone for ServiceConfig
impl Clone for ServiceConfig
Source§fn clone(&self) -> ServiceConfig
fn clone(&self) -> ServiceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more