Skip to main content

RuntimeConfigBuilder

Struct RuntimeConfigBuilder 

Source
pub struct RuntimeConfigBuilder { /* private fields */ }
Expand description

Builder for RuntimeConfig.

Implementations§

Source§

impl RuntimeConfigBuilder

Source

pub fn bind(self, addr: SocketAddr) -> Self

Set the bind address.

Source

pub fn max_connections(self, max: usize) -> Self

Set the maximum number of concurrent connections.

Must be > 0. Default: 64.

Source

pub fn max_file_streams(self, max: usize) -> Self

Set the maximum number of concurrent file-stream responses.

Must be > 0. Default: 32.

Source

pub fn header_read_timeout(self, timeout: Duration) -> Self

Set the header-read timeout.

Source

pub fn connection_total_timeout(self, timeout: Duration) -> Self

Set the connection total timeout.

Source

pub fn handler_timeout(self, timeout: Duration) -> Self

Set the handler invocation timeout.

Source

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.

Source

pub fn graceful_shutdown_timeout(self, timeout: Duration) -> Self

Set the graceful shutdown grace period.

Source

pub fn server_header(self, header: String) -> Self

Set the server identification header value.

If set, added as Server header on all responses.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for RuntimeConfigBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RuntimeConfigBuilder

Source§

fn default() -> RuntimeConfigBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.