Struct actix_http::h1::H1Service [−][src]
pub struct H1Service<T, S, B, X = ExpectHandler, U = UpgradeHandler> { /* fields omitted */ }
Expand description
ServiceFactory
implementation for HTTP1 transport
Implementations
impl<S, B, X, U> H1Service<TlsStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Request, Config = ()>,
S::Future: 'static,
S::Error: Into<Response<AnyBody>>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
B::Error: Into<Box<dyn StdError>>,
X: ServiceFactory<Request, Config = (), Response = Request>,
X::Future: 'static,
X::Error: Into<Response<AnyBody>>,
X::InitError: Debug,
U: ServiceFactory<(Request, Framed<TlsStream<TcpStream>, Codec>), Config = (), Response = ()>,
U::Future: 'static,
U::Error: Display + Into<Response<AnyBody>>,
U::InitError: Debug,
impl<S, B, X, U> H1Service<TlsStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Request, Config = ()>,
S::Future: 'static,
S::Error: Into<Response<AnyBody>>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
B::Error: Into<Box<dyn StdError>>,
X: ServiceFactory<Request, Config = (), Response = Request>,
X::Future: 'static,
X::Error: Into<Response<AnyBody>>,
X::InitError: Debug,
U: ServiceFactory<(Request, Framed<TlsStream<TcpStream>, Codec>), Config = (), Response = ()>,
U::Future: 'static,
U::Error: Display + Into<Response<AnyBody>>,
U::InitError: Debug,
pub fn openssl(
self,
acceptor: SslAcceptor
) -> impl ServiceFactory<TcpStream, Config = (), Response = (), Error = TlsError<SslError, DispatchError>, InitError = ()>
pub fn openssl(
self,
acceptor: SslAcceptor
) -> impl ServiceFactory<TcpStream, Config = (), Response = (), Error = TlsError<SslError, DispatchError>, InitError = ()>
Create openssl based service
impl<S, B, X, U> H1Service<TlsStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Request, Config = ()>,
S::Future: 'static,
S::Error: Into<Response<AnyBody>>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
B::Error: Into<Box<dyn StdError>>,
X: ServiceFactory<Request, Config = (), Response = Request>,
X::Future: 'static,
X::Error: Into<Response<AnyBody>>,
X::InitError: Debug,
U: ServiceFactory<(Request, Framed<TlsStream<TcpStream>, Codec>), Config = (), Response = ()>,
U::Future: 'static,
U::Error: Display + Into<Response<AnyBody>>,
U::InitError: Debug,
impl<S, B, X, U> H1Service<TlsStream<TcpStream>, S, B, X, U> where
S: ServiceFactory<Request, Config = ()>,
S::Future: 'static,
S::Error: Into<Response<AnyBody>>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
B::Error: Into<Box<dyn StdError>>,
X: ServiceFactory<Request, Config = (), Response = Request>,
X::Future: 'static,
X::Error: Into<Response<AnyBody>>,
X::InitError: Debug,
U: ServiceFactory<(Request, Framed<TlsStream<TcpStream>, Codec>), Config = (), Response = ()>,
U::Future: 'static,
U::Error: Display + Into<Response<AnyBody>>,
U::InitError: Debug,
pub fn rustls(
self,
config: ServerConfig
) -> impl ServiceFactory<TcpStream, Config = (), Response = (), Error = TlsError<Error, DispatchError>, InitError = ()>
pub fn rustls(
self,
config: ServerConfig
) -> impl ServiceFactory<TcpStream, Config = (), Response = (), Error = TlsError<Error, DispatchError>, InitError = ()>
Create rustls based service
impl<S, B, X, U> H1Service<TcpStream, S, B, X, U> where
S: ServiceFactory<Request, Config = ()>,
S::Future: 'static,
S::Error: Into<Response<AnyBody>>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
B::Error: Into<Box<dyn StdError>>,
X: ServiceFactory<Request, Config = (), Response = Request>,
X::Future: 'static,
X::Error: Into<Response<AnyBody>>,
X::InitError: Debug,
U: ServiceFactory<(Request, Framed<TcpStream, Codec>), Config = (), Response = ()>,
U::Future: 'static,
U::Error: Display + Into<Response<AnyBody>>,
U::InitError: Debug,
impl<S, B, X, U> H1Service<TcpStream, S, B, X, U> where
S: ServiceFactory<Request, Config = ()>,
S::Future: 'static,
S::Error: Into<Response<AnyBody>>,
S::InitError: Debug,
S::Response: Into<Response<B>>,
B: MessageBody,
B::Error: Into<Box<dyn StdError>>,
X: ServiceFactory<Request, Config = (), Response = Request>,
X::Future: 'static,
X::Error: Into<Response<AnyBody>>,
X::InitError: Debug,
U: ServiceFactory<(Request, Framed<TcpStream, Codec>), Config = (), Response = ()>,
U::Future: 'static,
U::Error: Display + Into<Response<AnyBody>>,
U::InitError: Debug,
pub fn tcp(
self
) -> impl ServiceFactory<TcpStream, Config = (), Response = (), Error = DispatchError, InitError = ()>
pub fn tcp(
self
) -> impl ServiceFactory<TcpStream, Config = (), Response = (), Error = DispatchError, InitError = ()>
Create simple tcp stream service
Trait Implementations
impl<T, S, B, X, U> ServiceFactory<(T, Option<SocketAddr>)> for H1Service<T, S, B, X, U> where
T: AsyncRead + AsyncWrite + Unpin + 'static,
S: ServiceFactory<Request, Config = ()>,
S::Future: 'static,
S::Error: Into<Response<AnyBody>>,
S::Response: Into<Response<B>>,
S::InitError: Debug,
B: MessageBody,
B::Error: Into<Box<dyn StdError>>,
X: ServiceFactory<Request, Config = (), Response = Request>,
X::Future: 'static,
X::Error: Into<Response<AnyBody>>,
X::InitError: Debug,
U: ServiceFactory<(Request, Framed<T, Codec>), Config = (), Response = ()>,
U::Future: 'static,
U::Error: Display + Into<Response<AnyBody>>,
U::InitError: Debug,
impl<T, S, B, X, U> ServiceFactory<(T, Option<SocketAddr>)> for H1Service<T, S, B, X, U> where
T: AsyncRead + AsyncWrite + Unpin + 'static,
S: ServiceFactory<Request, Config = ()>,
S::Future: 'static,
S::Error: Into<Response<AnyBody>>,
S::Response: Into<Response<B>>,
S::InitError: Debug,
B: MessageBody,
B::Error: Into<Box<dyn StdError>>,
X: ServiceFactory<Request, Config = (), Response = Request>,
X::Future: 'static,
X::Error: Into<Response<AnyBody>>,
X::InitError: Debug,
U: ServiceFactory<(Request, Framed<T, Codec>), Config = (), Response = ()>,
U::Future: 'static,
U::Error: Display + Into<Response<AnyBody>>,
U::InitError: Debug,
type Error = DispatchError
type Error = DispatchError
Errors produced by the created services.
type Service = H1ServiceHandler<T, S::Service, B, X::Service, U::Service>
type Service = H1ServiceHandler<T, S::Service, B, X::Service, U::Service>
The kind of Service
created by this factory.
type Future = LocalBoxFuture<'static, Result<Self::Service, Self::InitError>>
type Future = LocalBoxFuture<'static, Result<Self::Service, Self::InitError>>
The future of the Service
instance.g
Create and return a new service asynchronously.
Auto Trait Implementations
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler> !RefUnwindSafe for H1Service<T, S, B, X, U>
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler> !Send for H1Service<T, S, B, X, U>
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler> !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,
U: Unpin,
X: Unpin,
impl<T, S, B, X = ExpectHandler, U = UpgradeHandler> !UnwindSafe for H1Service<T, S, B, X, U>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Convert Self
to a ServiceFactory
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, Req, E> where
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, F, Req, E> where
F: Fn(Self::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Call another service after call to this one has resolved successfully.