pub struct H1Service<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> { /* private fields */ }Expand description
ServiceFactory implementation for HTTP1 transport
Implementations§
Source§impl<S, B, X, U> H1Service<SslStream<TcpStream>, S, B, X, U>where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: Into<Error>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: Into<Error>,
X::InitError: Debug,
U: ServiceFactory<Config = (), Request = (Request, Framed<SslStream<TcpStream>, Codec>), Response = ()>,
U::Error: Display + Into<Error>,
U::InitError: Debug,
impl<S, B, X, U> H1Service<SslStream<TcpStream>, S, B, X, U>where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: Into<Error>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: Into<Error>,
X::InitError: Debug,
U: ServiceFactory<Config = (), Request = (Request, Framed<SslStream<TcpStream>, Codec>), Response = ()>,
U::Error: Display + Into<Error>,
U::InitError: Debug,
Sourcepub fn openssl(
self,
acceptor: SslAcceptor,
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<HandshakeError<TcpStream>, DispatchError>, InitError = ()>
pub fn openssl( self, acceptor: SslAcceptor, ) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<HandshakeError<TcpStream>, DispatchError>, InitError = ()>
Create openssl based service
Source§impl<S, B, X, U> H1Service<TlsStream<TcpStream>, S, B, X, U>where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: Into<Error>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: Into<Error>,
X::InitError: Debug,
U: ServiceFactory<Config = (), Request = (Request, Framed<TlsStream<TcpStream>, Codec>), Response = ()>,
U::Error: Display + Into<Error>,
U::InitError: Debug,
impl<S, B, X, U> H1Service<TlsStream<TcpStream>, S, B, X, U>where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: Into<Error>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: Into<Error>,
X::InitError: Debug,
U: ServiceFactory<Config = (), Request = (Request, Framed<TlsStream<TcpStream>, Codec>), Response = ()>,
U::Error: Display + Into<Error>,
U::InitError: Debug,
Sourcepub fn rustls(
self,
config: ServerConfig,
) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<Error, DispatchError>, InitError = ()>
pub fn rustls( self, config: ServerConfig, ) -> impl ServiceFactory<Config = (), Request = TcpStream, Response = (), Error = SslError<Error, DispatchError>, InitError = ()>
Create rustls based service
Source§impl<S, B, X, U> H1Service<TcpStream, S, B, X, U>where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: Into<Error>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: Into<Error>,
X::InitError: Debug,
U: ServiceFactory<Config = (), Request = (Request, Framed<TcpStream, Codec>), Response = ()>,
U::Error: Display + Into<Error>,
U::InitError: Debug,
impl<S, B, X, U> H1Service<TcpStream, S, B, X, U>where
S: ServiceFactory<Config = (), Request = Request>,
S::Error: Into<Error>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: Into<Error>,
X::InitError: Debug,
U: ServiceFactory<Config = (), Request = (Request, Framed<TcpStream, Codec>), Response = ()>,
U::Error: Display + Into<Error>,
U::InitError: Debug,
Sourcepub 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
Trait Implementations§
Source§impl<T, S, B, X, U> ServiceFactory for H1Service<T, S, B, X, U>where
T: AsyncRead + AsyncWrite + Unpin,
S: ServiceFactory<Config = (), Request = Request>,
S::Error: Into<Error>,
S::Response: Into<Response<B>>,
S::InitError: Debug,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: Into<Error>,
X::InitError: Debug,
U: ServiceFactory<Config = (), Request = (Request, Framed<T, Codec>), Response = ()>,
U::Error: Display + Into<Error>,
U::InitError: Debug,
impl<T, S, B, X, U> ServiceFactory for H1Service<T, S, B, X, U>where
T: AsyncRead + AsyncWrite + Unpin,
S: ServiceFactory<Config = (), Request = Request>,
S::Error: Into<Error>,
S::Response: Into<Response<B>>,
S::InitError: Debug,
B: MessageBody,
X: ServiceFactory<Config = (), Request = Request, Response = Request>,
X::Error: Into<Error>,
X::InitError: Debug,
U: ServiceFactory<Config = (), Request = (Request, Framed<T, Codec>), Response = ()>,
U::Error: Display + Into<Error>,
U::InitError: Debug,
Source§type Request = (T, Option<SocketAddr>)
type Request = (T, Option<SocketAddr>)
Requests handled by the service.
Source§type Error = DispatchError
type Error = DispatchError
Errors produced by the service
Source§type Service = H1ServiceHandler<T, <S as ServiceFactory>::Service, B, <X as ServiceFactory>::Service, <U as ServiceFactory>::Service>
type Service = H1ServiceHandler<T, <S as ServiceFactory>::Service, B, <X as ServiceFactory>::Service, <U as ServiceFactory>::Service>
The
Service value created by this factorySource§fn new_service(&self, _: ()) -> Self::Future
fn new_service(&self, _: ()) -> Self::Future
Create and return a new service value asynchronously.
Source§fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R>
fn map<F, R>(self, f: F) -> MapServiceFactory<Self, F, R>
Map this service’s output to a different type, returning a new service
of the resulting type.
Source§fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E>
fn map_err<F, E>(self, f: F) -> MapErrServiceFactory<Self, F, E>
Map this service’s error to a different error, returning a new service.
Source§fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E>
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, E>
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations§
impl<T, S, B, X, U> Freeze for H1Service<T, S, B, X, U>
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>
impl<T, S, B, X, U> UnsafeUnpin for H1Service<T, S, B, X, U>
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler<T>> !UnwindSafe for H1Service<T, S, B, X, U>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoServiceFactory<T> for Twhere
T: ServiceFactory,
impl<T> IntoServiceFactory<T> for Twhere
T: ServiceFactory,
Source§fn into_factory(self) -> T
fn into_factory(self) -> T
Convert
Self to a ServiceFactory