pub struct RuntimeConfigBuilder { /* private fields */ }Expand description
Builder for RuntimeConfig.
Implementations§
Source§impl RuntimeConfigBuilder
impl RuntimeConfigBuilder
Sourcepub fn bind(self, addr: SocketAddr) -> Self
pub fn bind(self, addr: SocketAddr) -> Self
Set the bind address.
Sourcepub fn max_connections(self, max: usize) -> Self
pub fn max_connections(self, max: usize) -> Self
Set the maximum number of concurrent connections.
Must be > 0. Default: 64.
Sourcepub fn max_file_streams(self, max: usize) -> Self
pub fn max_file_streams(self, max: usize) -> Self
Set the maximum number of concurrent file-stream responses.
Must be > 0. Default: 32.
Sourcepub fn header_read_timeout(self, timeout: Duration) -> Self
pub fn header_read_timeout(self, timeout: Duration) -> Self
Set the header-read timeout.
Sourcepub fn connection_total_timeout(self, timeout: Duration) -> Self
pub fn connection_total_timeout(self, timeout: Duration) -> Self
Set the connection total timeout.
Sourcepub fn handler_timeout(self, timeout: Duration) -> Self
pub fn handler_timeout(self, timeout: Duration) -> Self
Set the handler invocation timeout.
Sourcepub fn body_read_timeout(self, timeout: Duration) -> Self
pub fn body_read_timeout(self, timeout: Duration) -> Self
Set the body read timeout.
This is a total deadline for body consumption, not an idle timeout.
Sourcepub fn graceful_shutdown_timeout(self, timeout: Duration) -> Self
pub fn graceful_shutdown_timeout(self, timeout: Duration) -> Self
Set the graceful shutdown grace period.
Sourcepub fn server_header(self, header: String) -> Self
pub fn server_header(self, header: String) -> Self
Set the server identification header value.
If set, added as Server header on all responses.
Sourcepub fn max_request_body_bytes(self, max: u64) -> Self
pub fn max_request_body_bytes(self, max: u64) -> Self
Set the maximum request body size in bytes.
This is the hard ceiling that no service can exceed. Default: 0 (bodies rejected). Set to a positive value to allow request bodies.
Sourcepub fn build(self) -> Result<RuntimeConfig, ServerError>
pub fn build(self) -> Result<RuntimeConfig, ServerError>
Build the runtime configuration.
Returns an error if max_connections, max_file_streams, or any
timeout duration is 0.