[][src]Struct actix_http::HttpServiceBuilder

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

A http service builder

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

Methods

impl<T, S> HttpServiceBuilder<T, S, ExpectHandler, UpgradeHandler<T>> where
    S: NewService<Config = SrvConfig, Request = Request>,
    S::Error: Into<Error>,
    S::InitError: Debug
[src]

pub fn new() -> Self[src]

Create instance of ServiceConfigBuilder

impl<T, S, X, U> HttpServiceBuilder<T, S, X, U> where
    S: NewService<Config = SrvConfig, Request = Request>,
    S::Error: Into<Error>,
    S::InitError: Debug,
    X: NewService<Config = SrvConfig, Request = Request, Response = Request>,
    X::Error: Into<Error>,
    X::InitError: Debug,
    U: NewService<Config = SrvConfig, Request = (Request, Framed<T, Codec>), Response = ()>,
    U::Error: Display,
    U::InitError: Debug
[src]

pub fn keep_alive<W: Into<KeepAlive>>(self, val: W) -> Self[src]

Set server keep-alive setting.

By default keep alive is set to a 5 seconds.

pub fn client_timeout(self, val: u64) -> Self[src]

Set server client timeout in milliseconds 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 5000 milliseconds.

pub fn client_disconnect(self, val: u64) -> Self[src]

Set server connection disconnect timeout in milliseconds.

Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the request get dropped. This timeout affects secure connections.

To disable timeout set value to 0.

By default disconnect timeout is set to 0.

pub fn expect<F, X1>(self, expect: F) -> HttpServiceBuilder<T, S, X1, U> where
    F: IntoNewService<X1>,
    X1: NewService<Config = SrvConfig, Request = Request, Response = Request>,
    X1::Error: Into<Error>,
    X1::InitError: Debug
[src]

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.

pub fn upgrade<F, U1>(self, upgrade: F) -> HttpServiceBuilder<T, S, X, U1> where
    F: IntoNewService<U1>,
    U1: NewService<Config = SrvConfig, Request = (Request, Framed<T, Codec>), Response = ()>,
    U1::Error: Display,
    U1::InitError: Debug
[src]

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.

pub fn on_connect<F, I>(self, f: F) -> Self where
    F: Fn(&T) -> I + 'static,
    I: Clone + 'static, 
[src]

Set on-connect callback.

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

pub fn h1<F, P, B>(self, service: F) -> H1Service<T, P, S, B, X, U> where
    B: MessageBody + 'static,
    F: IntoNewService<S>,
    S::Error: Into<Error>,
    S::InitError: Debug,
    S::Response: Into<Response<B>>, 
[src]

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

pub fn h2<F, P, B>(self, service: F) -> H2Service<T, P, S, B> where
    B: MessageBody + 'static,
    F: IntoNewService<S>,
    S::Error: Into<Error>,
    S::InitError: Debug,
    S::Response: Into<Response<B>>,
    <S::Service as Service>::Future: 'static, 
[src]

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

pub fn finish<F, P, B>(self, service: F) -> HttpService<T, P, S, B, X, U> where
    B: MessageBody + 'static,
    F: IntoNewService<S>,
    S::Error: Into<Error>,
    S::InitError: Debug,
    S::Response: Into<Response<B>>,
    <S::Service as Service>::Future: 'static, 
[src]

Finish service configuration and create HttpService instance.

Auto Trait Implementations

impl<T, S, X, U> Unpin for HttpServiceBuilder<T, S, X, U> where
    S: Unpin,
    T: Unpin,
    U: Unpin,
    X: Unpin

impl<T, S, X = ExpectHandler, U = UpgradeHandler<T>> !Sync for HttpServiceBuilder<T, S, X, U>

impl<T, S, X = ExpectHandler, U = UpgradeHandler<T>> !Send for HttpServiceBuilder<T, S, X, U>

impl<T, S, X = ExpectHandler, U = UpgradeHandler<T>> !UnwindSafe for HttpServiceBuilder<T, S, X, U>

impl<T, S, X = ExpectHandler, U = UpgradeHandler<T>> !RefUnwindSafe for HttpServiceBuilder<T, S, X, U>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,