pub struct HttpServiceConfig<const HEADER_LIMIT: usize = DEFAULT_HEADER_LIMIT, const READ_BUF_LIMIT: usize = DEFAULT_READ_BUF_LIMIT, const WRITE_BUF_LIMIT: usize = DEFAULT_WRITE_BUF_LIMIT> { /* private fields */ }

Implementations§

source§

impl HttpServiceConfig

source

pub const fn new() -> Self

source§

impl<const HEADER_LIMIT: usize, const READ_BUF_LIMIT: usize, const WRITE_BUF_LIMIT: usize> HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

source

pub fn disable_vectored_write(self) -> Self

Disable vectored write even when IO is able to perform it.

This is beneficial when dealing with small size of response body.

source

pub fn keep_alive_timeout(self, dur: Duration) -> Self

Define duration of how long an idle connection is kept alive.

connection have not done any IO after duration would be closed. IO operation can possibly result in reset of the duration.

source

pub fn request_head_timeout(self, dur: Duration) -> Self

Define duration of how long a connection must finish it’s request head transferring. starting from first byte(s) of current request(s) received from peer.

connection can not make a single request after duration would be closed.

source

pub fn tls_accept_timeout(self, dur: Duration) -> Self

Define duration of how long a connection must finish it’s tls handshake. (If tls is enabled)

Connection can not finish handshake after duration would be closed.

source

pub fn max_read_buf_size<const READ_BUF_LIMIT_2: usize>( self ) -> HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT_2, WRITE_BUF_LIMIT>

Define max read buffer size for a connection.

See DEFAULT_READ_BUF_LIMIT for default value and behavior.

source

pub fn max_write_buf_size<const WRITE_BUF_LIMIT_2: usize>( self ) -> HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT_2>

Define max write buffer size for a connection.

See DEFAULT_WRITE_BUF_LIMIT for default value and behavior.

source

pub fn max_request_headers<const HEADER_LIMIT_2: usize>( self ) -> HttpServiceConfig<HEADER_LIMIT_2, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

Define max request header count for a connection.

See DEFAULT_HEADER_LIMIT for default value and behavior.

source

pub fn peek_protocol(self) -> Self

Enable peek into connection to figure out it’s protocol regardless the outcome of alpn negotiation.

This API is used to bypass alpn setting from tls and enable Http/2 protocol over plain Tcp connection.

Trait Implementations§

source§

impl<const HEADER_LIMIT: usize, const READ_BUF_LIMIT: usize, const WRITE_BUF_LIMIT: usize> Clone for HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

source§

fn clone( &self ) -> HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

Returns a copy 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 Default for HttpServiceConfig

source§

fn default() -> Self

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

impl<const HEADER_LIMIT: usize, const READ_BUF_LIMIT: usize, const WRITE_BUF_LIMIT: usize> Copy for HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

Auto Trait Implementations§

§

impl<const HEADER_LIMIT: usize, const READ_BUF_LIMIT: usize, const WRITE_BUF_LIMIT: usize> RefUnwindSafe for HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

§

impl<const HEADER_LIMIT: usize, const READ_BUF_LIMIT: usize, const WRITE_BUF_LIMIT: usize> Send for HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

§

impl<const HEADER_LIMIT: usize, const READ_BUF_LIMIT: usize, const WRITE_BUF_LIMIT: usize> Sync for HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

§

impl<const HEADER_LIMIT: usize, const READ_BUF_LIMIT: usize, const WRITE_BUF_LIMIT: usize> Unpin for HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

§

impl<const HEADER_LIMIT: usize, const READ_BUF_LIMIT: usize, const WRITE_BUF_LIMIT: usize> UnwindSafe for HttpServiceConfig<HEADER_LIMIT, READ_BUF_LIMIT, WRITE_BUF_LIMIT>

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

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more