Struct ntex::http::HttpServiceBuilder[][src]

pub struct HttpServiceBuilder<T, S, X = ExpectHandler, U = UpgradeHandler<T>> { /* fields omitted */ }
Expand description

A http service builder

This type can be used to construct an instance of http service through a builder-like pattern.

Implementations

Create instance of ServiceConfigBuilder

Set server keep-alive setting.

By default keep alive is set to a 5 seconds.

Set server client timeout for first request.

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.

Set server connection disconnect timeout in seconds.

Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.

To disable timeout set value to 0.

By default disconnect timeout is set to 3 seconds.

Set server ssl handshake timeout.

Defines a timeout for connection ssl handshake negotiation. To disable timeout set value to 0.

By default handshake timeout is set to 5 seconds.

Set read/write buffer params

By default read buffer is 8kb, write buffer is 8kb

Provide service for EXPECT: 100-Continue support.

Service get called with request that contains EXPECT header. Service must return request in case of success, in that case request will be forwarded to main service.

Provide service for custom Connection: UPGRADE support.

If service is provided then normal requests handling get halted and this service get called with original request and framed object.

Set on-connect callback.

It get called once per connection and result of the call get stored to the request’s extensions.

Set req request callback.

It get called once per request.

Finish service configuration and create http service for HTTP/1 protocol.

Finish service configuration and create http service for HTTP/2 protocol.

Finish service configuration and create HttpService instance.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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