Struct ntex::http::h1::H1Service [−][src]
pub struct H1Service<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> { /* fields omitted */ }
Expand description
ServiceFactory
implementation for HTTP1 transport
Implementations
impl<S, B, X, U> H1Service<SslStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>>,
S::Future: 'static,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, SslStream<TcpStream>, IoState, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
impl<S, B, X, U> H1Service<SslStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>>,
S::Future: 'static,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, SslStream<TcpStream>, IoState, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
pub fn openssl(
self,
acceptor: SslAcceptor
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<DispatchError>, InitError = ()>
pub fn openssl(
self,
acceptor: SslAcceptor
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<DispatchError>, InitError = ()>
Create openssl based service
impl<S, B, X, U> H1Service<TlsStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>>,
S::Future: 'static,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, TlsStream<TcpStream>, IoState, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
impl<S, B, X, U> H1Service<TlsStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>>,
S::Future: 'static,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, TlsStream<TcpStream>, IoState, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
pub fn rustls(
self,
config: ServerConfig
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<DispatchError>, InitError = ()>
pub fn rustls(
self,
config: ServerConfig
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<DispatchError>, InitError = ()>
Create rustls based service
impl<S, B, X, U> H1Service<TcpStream, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>>,
S::Future: 'static,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, TcpStream, IoState, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
impl<S, B, X, U> H1Service<TcpStream, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::InitError: Debug,
S::Response: Into<Response<B>>,
S::Future: 'static,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, TcpStream, IoState, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
pub fn tcp(
self
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = DispatchError, InitError = ()>
pub fn tcp(
self
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = DispatchError, InitError = ()>
Create simple tcp stream service
impl<T, S, B, X, U> H1Service<T, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::Response: Into<Response<B>>,
S::InitError: Debug,
S::Future: 'static,
B: MessageBody,
impl<T, S, B, X, U> H1Service<T, S, B, X, U> where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::Response: Into<Response<B>>,
S::InitError: Debug,
S::Future: 'static,
B: MessageBody,
pub fn expect<X1>(self, expect: X1) -> H1Service<T, S, B, X1, U> where
X1: ServiceFactory<Request = Request, Response = Request>,
X1::Error: ResponseError + 'static,
X1::InitError: Debug,
X1::Future: 'static,
Trait Implementations
impl<T, S, B, X, U> ServiceFactory for H1Service<T, S, B, X, U> where
T: AsyncRead + AsyncWrite + Unpin + 'static,
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::Response: Into<Response<B>>,
S::InitError: Debug,
S::Future: 'static,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, T, IoState, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
impl<T, S, B, X, U> ServiceFactory for H1Service<T, S, B, X, U> where
T: AsyncRead + AsyncWrite + Unpin + 'static,
S: ServiceFactory<Config = (), Request = Request>,
S::Error: ResponseError + 'static,
S::Response: Into<Response<B>>,
S::InitError: Debug,
S::Future: 'static,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: ResponseError + 'static,
X::InitError: Debug,
X::Future: 'static,
U: ServiceFactory<Config = (), Request = (Request, T, IoState, Codec), Response = ()>,
U::Error: Display + Error + 'static,
U::InitError: Debug,
U::Future: 'static,
type Request = (T, Option<SocketAddr>)
type Request = (T, Option<SocketAddr>)
Requests handled by the service.
type Error = DispatchError
type Error = DispatchError
Errors produced by the service
type Service = H1ServiceHandler<T, S::Service, B, X::Service, U::Service>
type Service = H1ServiceHandler<T, S::Service, B, X::Service, U::Service>
The Service
value created by this factory
The future of the ServiceFactory
instance.
Create and return a new service value asynchronously.
Map this service’s output to a different type, returning a new service of the resulting type. Read more
Map this service’s error to a different error, returning a new service.
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E> where
F: Fn(Self::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !RefUnwindSafe for H1Service<T, S, B, X, U>
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !Send for H1Service<T, S, B, X, U>
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !Sync for H1Service<T, S, B, X, U>
impl<T, S, B, X, U> Unpin for H1Service<T, S, B, X, U> where
B: Unpin,
S: Unpin,
T: Unpin,
U: Unpin,
X: Unpin,
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !UnwindSafe for H1Service<T, S, B, X, U>
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Self
to a ServiceFactory
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