Struct ntex::http::HttpServiceBuilder [−][src]
pub struct HttpServiceBuilder<F, S, X = ExpectHandler, U = UpgradeHandler<F>> { /* 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
impl<F, S, X, U> HttpServiceBuilder<F, S, X, U> where
F: Filter,
S: ServiceFactory<Request> + 'static,
S::Error: ResponseError,
S::InitError: Debug,
X: ServiceFactory<Request, Response = Request> + 'static,
X::Error: ResponseError,
X::InitError: Debug,
U: ServiceFactory<(Request, Io<F>, Codec), Response = ()> + 'static,
U::Error: Display + Error,
U::InitError: Debug,
impl<F, S, X, U> HttpServiceBuilder<F, S, X, U> where
F: Filter,
S: ServiceFactory<Request> + 'static,
S::Error: ResponseError,
S::InitError: Debug,
X: ServiceFactory<Request, Response = Request> + 'static,
X::Error: ResponseError,
X::InitError: Debug,
U: ServiceFactory<(Request, Io<F>, Codec), Response = ()> + 'static,
U::Error: Display + Error,
U::InitError: Debug,
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.
pub fn expect<XF, X1>(self, expect: XF) -> HttpServiceBuilder<F, S, X1, U> where
XF: IntoServiceFactory<X1, Request>,
X1: ServiceFactory<Request, Response = Request>,
X1::InitError: Debug,
pub fn expect<XF, X1>(self, expect: XF) -> HttpServiceBuilder<F, S, X1, U> where
XF: IntoServiceFactory<X1, Request>,
X1: ServiceFactory<Request, Response = Request>,
X1::InitError: Debug,
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 req request callback.
It get called once per request.
pub fn h1<B, SF>(self, service: SF) -> H1Service<F, S, B, X, U> where
B: MessageBody,
SF: IntoServiceFactory<S, Request>,
S::Error: ResponseError,
S::InitError: Debug,
S::Response: Into<Response<B>>,
pub fn h1<B, SF>(self, service: SF) -> H1Service<F, S, B, X, U> where
B: MessageBody,
SF: IntoServiceFactory<S, Request>,
S::Error: ResponseError,
S::InitError: Debug,
S::Response: Into<Response<B>>,
Finish service configuration and create http service for HTTP/1 protocol.
Finish service configuration and create http service for HTTP/2 protocol.
pub fn finish<B, SF>(self, service: SF) -> HttpService<F, S, B, X, U> where
B: MessageBody + 'static,
SF: IntoServiceFactory<S, Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service<Request>>::Future: 'static,
pub fn finish<B, SF>(self, service: SF) -> HttpService<F, S, B, X, U> where
B: MessageBody + 'static,
SF: IntoServiceFactory<S, Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service<Request>>::Future: 'static,
Finish service configuration and create HttpService
instance.
Auto Trait Implementations
impl<F, S, X = ExpectHandler, U = UpgradeHandler<F>> !RefUnwindSafe for HttpServiceBuilder<F, S, X, U>
impl<F, S, X = ExpectHandler, U = UpgradeHandler<F>> !Send for HttpServiceBuilder<F, S, X, U>
impl<F, S, X = ExpectHandler, U = UpgradeHandler<F>> !Sync for HttpServiceBuilder<F, S, X, U>
impl<F, S, X, U> Unpin for HttpServiceBuilder<F, S, X, U> where
F: Unpin,
S: Unpin,
U: Unpin,
X: Unpin,
impl<F, S, X = ExpectHandler, U = UpgradeHandler<F>> !UnwindSafe for HttpServiceBuilder<F, S, X, U>
Blanket Implementations
Mutably borrows from an owned value. Read more
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