[−][src]Struct ntex::http::HttpService
ServiceFactory
HTTP1.1/HTTP2 transport implementation
Implementations
impl<S, B, X, U> HttpService<SslStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, SslStream<TcpStream>, State, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
<U::Service as Service>::Future: 'static,
[src]
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, SslStream<TcpStream>, State, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
<U::Service as Service>::Future: 'static,
pub fn openssl(
self,
acceptor: SslAcceptor
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<DispatchError>, InitError = ()>
[src]
self,
acceptor: SslAcceptor
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<DispatchError>, InitError = ()>
Create openssl based service
impl<S, B, X, U> HttpService<TlsStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Future: 'static,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, TlsStream<TcpStream>, State, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
<U::Service as Service>::Future: 'static,
[src]
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Future: 'static,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, TlsStream<TcpStream>, State, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
<U::Service as Service>::Future: 'static,
pub fn rustls(
self,
mut config: ServerConfig
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<DispatchError>, InitError = ()>
[src]
self,
mut config: ServerConfig
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<DispatchError>, InitError = ()>
Create openssl based service
impl<T, S, B> HttpService<T, S, B> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
[src]
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
pub fn build() -> HttpServiceBuilder<T, S>
[src]
Create builder for HttpService
instance.
impl<T, S, B> HttpService<T, S, B> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
[src]
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
pub fn new<F: IntoServiceFactory<S>>(service: F) -> Self
[src]
Create new HttpService
instance.
impl<T, S, B, X, U> HttpService<T, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody,
[src]
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody,
pub fn expect<X1>(self, expect: X1) -> HttpService<T, S, B, X1, U> where
X1: ServiceFactory<Config = (), Request = Request, Response = Request>,
X1::Error: ResponseError,
X1::InitError: Debug,
X1::Future: 'static,
[src]
X1: ServiceFactory<Config = (), Request = Request, Response = Request>,
X1::Error: ResponseError,
X1::InitError: Debug,
X1::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<U1>(self, upgrade: Option<U1>) -> HttpService<T, S, B, X, U1> where
U1: ServiceFactory<Config = (), Request = (Request, T, State, Codec), Response = ()>,
U1::Error: Display + Error + 'static,
U1::InitError: Debug,
U1::Future: 'static,
[src]
U1: ServiceFactory<Config = (), Request = (Request, T, State, Codec), Response = ()>,
U1::Error: Display + Error + 'static,
U1::InitError: Debug,
U1::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.
impl<S, B, X, U> HttpService<TcpStream, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, TcpStream, State, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
<U::Service as Service>::Future: 'static,
[src]
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>> + 'static,
S::Future: 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, TcpStream, State, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
<U::Service as Service>::Future: 'static,
pub fn tcp(
self
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = DispatchError, InitError = ()>
[src]
self
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = DispatchError, InitError = ()>
Create simple tcp stream service
Trait Implementations
impl<T, S, B, X, U> ServiceFactory for HttpService<T, S, B, X, U> where
T: AsyncRead + AsyncWrite + Unpin + 'static,
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Future: 'static,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, T, State, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
<U::Service as Service>::Future: 'static,
[src]
T: AsyncRead + AsyncWrite + Unpin + 'static,
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Future: 'static,
S::Response: Into<Response<B>> + 'static,
<S::Service as Service>::Future: 'static,
B: MessageBody + 'static,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
<X::Service as Service>::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, T, State, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
<U::Service as Service>::Future: 'static,
type Config = ()
Service factory configuration
type Request = (T, Protocol, Option<SocketAddr>)
Requests handled by the service.
type Response = ()
Responses given by the service
type Error = DispatchError
Errors produced by the service
type InitError = ()
Errors produced while building a service.
type Service = HttpServiceHandler<T, S::Service, B, X::Service, U::Service>
The Service
value created by this factory
type Future = LocalBoxFuture<'static, Result<Self::Service, Self::InitError>>
The future of the ServiceFactory
instance.
fn new_service(&self, _: ()) -> Self::Future
[src]
pub fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R> where
F: FnMut(Self::Response) -> R + Clone,
[src]
F: FnMut(Self::Response) -> R + Clone,
pub fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E> where
F: Fn(Self::Error) -> E + Clone,
[src]
F: Fn(Self::Error) -> E + Clone,
pub fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
[src]
F: Fn(Self::InitError) -> E + Clone,
Auto Trait Implementations
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !RefUnwindSafe for HttpService<T, S, B, X, U>
[src]
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !Send for HttpService<T, S, B, X, U>
[src]
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !Sync for HttpService<T, S, B, X, U>
[src]
impl<T, S, B, X, U> Unpin for HttpService<T, S, B, X, U> where
B: Unpin,
S: Unpin,
T: Unpin,
U: Unpin,
X: Unpin,
[src]
B: Unpin,
S: Unpin,
T: Unpin,
U: Unpin,
X: Unpin,
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !UnwindSafe for HttpService<T, S, B, 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> IntoServiceFactory<T> for T where
T: ServiceFactory,
[src]
T: ServiceFactory,
pub fn into_factory(self) -> T
[src]
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>,