Skip to main content

HttpServiceConfig

Struct HttpServiceConfig 

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

Http service configuration

Implementations§

Source§

impl HttpServiceConfig

Source

pub fn new() -> HttpServiceConfig

Create instance of HttpServiceConfig

Source

pub fn set_keepalive<W: Into<KeepAlive>>(self, val: W) -> Self

Set server keep-alive setting

By default keep alive is set to a 5 seconds.

Source

pub fn set_keepalive_timeout(self, timeout: Seconds) -> Self

Set keep-alive timeout in seconds.

To disable timeout set value to 0.

By default keep-alive timeout is set to 30 seconds.

Source

pub fn set_client_timeout(self, timeout: Seconds) -> Self

Set request headers read timeout.

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 3 seconds.

Source

pub fn set_headers_read_rate( self, timeout: Seconds, max_timeout: Seconds, rate: u32, ) -> Self

Set read rate parameters for request headers.

Set read timeout, max timeout and rate for reading request headers. If the client sends rate amount of data within timeout period of time, extend timeout by timeout seconds. But no more than max_timeout timeout.

By default headers read rate is set to 1sec with max timeout 5sec.

Source

pub fn set_payload_read_rate( self, timeout: Seconds, max_timeout: Seconds, rate: u32, ) -> Self

Set read rate parameters for request’s payload.

Set read timeout, max timeout and rate for reading payload. If the client sends rate amount of data within timeout period of time, extend timeout by timeout seconds. But no more than max_timeout timeout.

By default payload read rate is disabled.

Trait Implementations§

Source§

impl Clone for HttpServiceConfig

Source§

fn clone(&self) -> HttpServiceConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Configuration for HttpServiceConfig

Source§

const NAME: &str = "Http service configuration"

Source§

fn ctx(&self) -> &CfgContext

Source§

fn set_ctx(&mut self, ctx: CfgContext)

Source§

impl Debug for HttpServiceConfig

Source§

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

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

impl Default for HttpServiceConfig

Source§

fn default() -> Self

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.