[−][src]Struct ntex::http::HttpServiceBuilder
A http service builder
This type can be used to construct an instance of http service
through a
builder-like pattern.
Implementations
impl<T, S> HttpServiceBuilder<T, S, ExpectHandler, UpgradeHandler<T>>
[src]
impl<T, S, X, U> HttpServiceBuilder<T, S, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
<S::Service as Service>::Future: 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError,
X::InitError: Debug,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, Framed<T, Codec>), Response = ()>,
U::Error: Display,
U::InitError: Debug,
<U::Service as Service>::Future: 'static,
[src]
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
<S::Service as Service>::Future: 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError,
X::InitError: Debug,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, Framed<T, Codec>), Response = ()>,
U::Error: Display,
U::InitError: Debug,
<U::Service as Service>::Future: 'static,
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 3 seconds.
pub fn disconnect_timeout(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 connection get dropped.
To disable timeout set value to 0.
By default disconnect timeout is set to 3 seconds.
pub fn ssl_handshake_timeout(self, val: u64) -> Self
[src]
Set server ssl handshake timeout in milliseconds.
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<F, X1>(self, expect: F) -> HttpServiceBuilder<T, S, X1, U> where
F: IntoServiceFactory<X1>,
X1: ServiceFactory<Config = (), Request = Request, Response = Request>,
X1::Error: ResponseError,
X1::InitError: Debug,
<X1::Service as Service>::Future: 'static,
[src]
F: IntoServiceFactory<X1>,
X1: ServiceFactory<Config = (), Request = Request, Response = Request>,
X1::Error: ResponseError,
X1::InitError: Debug,
<X1::Service as Service>::Future: 'static,
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: IntoServiceFactory<U1>,
U1: ServiceFactory<Config = (), Request = (Request, Framed<T, Codec>), Response = ()>,
U1::Error: Display,
U1::InitError: Debug,
<U1::Service as Service>::Future: 'static,
[src]
F: IntoServiceFactory<U1>,
U1: ServiceFactory<Config = (), Request = (Request, Framed<T, Codec>), Response = ()>,
U1::Error: Display,
U1::InitError: Debug,
<U1::Service as Service>::Future: 'static,
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]
F: Fn(&T) -> I + 'static,
I: Clone + 'static,
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, B>(self, service: F) -> H1Service<T, S, B, X, U> where
B: MessageBody,
F: IntoServiceFactory<S>,
S::Error: ResponseError,
S::InitError: Debug,
S::Response: Into<Response<B>>,
[src]
B: MessageBody,
F: IntoServiceFactory<S>,
S::Error: ResponseError,
S::InitError: Debug,
S::Response: Into<Response<B>>,
Finish service configuration and create http service for HTTP/1 protocol.
pub fn h2<F, B>(self, service: F) -> H2Service<T, S, B> where
B: MessageBody + 'static,
F: IntoServiceFactory<S>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
[src]
B: MessageBody + 'static,
F: IntoServiceFactory<S>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
Finish service configuration and create http service for HTTP/2 protocol.
pub fn finish<F, B>(self, service: F) -> HttpService<T, S, B, X, U> where
B: MessageBody + 'static,
F: IntoServiceFactory<S>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
[src]
B: MessageBody + 'static,
F: IntoServiceFactory<S>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
Finish service configuration and create HttpService
instance.
Auto Trait Implementations
impl<T, S, X = ExpectHandler, U = UpgradeHandler<T>> !RefUnwindSafe for HttpServiceBuilder<T, S, X, U>
[src]
impl<T, S, X = ExpectHandler, U = UpgradeHandler<T>> !Send for HttpServiceBuilder<T, S, X, U>
[src]
impl<T, S, X = ExpectHandler, U = UpgradeHandler<T>> !Sync for HttpServiceBuilder<T, S, X, U>
[src]
impl<T, S, X, U> Unpin for HttpServiceBuilder<T, S, X, U> where
S: Unpin,
T: Unpin,
U: Unpin,
X: Unpin,
[src]
S: Unpin,
T: Unpin,
U: Unpin,
X: Unpin,
impl<T, S, X = ExpectHandler, U = UpgradeHandler<T>> !UnwindSafe for HttpServiceBuilder<T, S, X, U>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,