mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-24 02:21:07 +01:00
fix feature gated code
This commit is contained in:
parent
dfbb77f98d
commit
aa2967c653
@ -26,8 +26,7 @@ impl<R, T, E> OpensslConnector<R, T, E> {
|
|||||||
impl<R: RequestHost, T: AsyncRead + AsyncWrite> OpensslConnector<R, T, ()> {
|
impl<R: RequestHost, T: AsyncRead + AsyncWrite> OpensslConnector<R, T, ()> {
|
||||||
pub fn service(
|
pub fn service(
|
||||||
connector: SslConnector,
|
connector: SslConnector,
|
||||||
) -> impl Service<Request = (R, T), Response = (R, SslStream<T>), Error = HandshakeError<T>>
|
) -> impl Service<(R, T), Response = (R, SslStream<T>), Error = HandshakeError<T>> {
|
||||||
{
|
|
||||||
OpensslConnectorService {
|
OpensslConnectorService {
|
||||||
connector: connector,
|
connector: connector,
|
||||||
_t: PhantomData,
|
_t: PhantomData,
|
||||||
@ -44,10 +43,9 @@ impl<R, T, E> Clone for OpensslConnector<R, T, E> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<R: RequestHost, T: AsyncRead + AsyncWrite, E> NewService<()>
|
impl<R: RequestHost, T: AsyncRead + AsyncWrite, E> NewService<(R, T), ()>
|
||||||
for OpensslConnector<R, T, E>
|
for OpensslConnector<R, T, E>
|
||||||
{
|
{
|
||||||
type Request = (R, T);
|
|
||||||
type Response = (R, SslStream<T>);
|
type Response = (R, SslStream<T>);
|
||||||
type Error = HandshakeError<T>;
|
type Error = HandshakeError<T>;
|
||||||
type Service = OpensslConnectorService<R, T>;
|
type Service = OpensslConnectorService<R, T>;
|
||||||
@ -67,8 +65,9 @@ pub struct OpensslConnectorService<R, T> {
|
|||||||
_t: PhantomData<(R, T)>,
|
_t: PhantomData<(R, T)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<R: RequestHost, T: AsyncRead + AsyncWrite> Service for OpensslConnectorService<R, T> {
|
impl<R: RequestHost, T: AsyncRead + AsyncWrite> Service<(R, T)>
|
||||||
type Request = (R, T);
|
for OpensslConnectorService<R, T>
|
||||||
|
{
|
||||||
type Response = (R, SslStream<T>);
|
type Response = (R, SslStream<T>);
|
||||||
type Error = HandshakeError<T>;
|
type Error = HandshakeError<T>;
|
||||||
type Future = ConnectAsyncExt<R, T>;
|
type Future = ConnectAsyncExt<R, T>;
|
||||||
|
@ -36,8 +36,7 @@ impl<T: AsyncRead + AsyncWrite> Clone for NativeTlsAcceptor<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: AsyncRead + AsyncWrite> NewService for NativeTlsAcceptor<T> {
|
impl<T: AsyncRead + AsyncWrite> NewService<T> for NativeTlsAcceptor<T> {
|
||||||
type Request = T;
|
|
||||||
type Response = TlsStream<T>;
|
type Response = TlsStream<T>;
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
type Service = NativeTlsAcceptorService<T>;
|
type Service = NativeTlsAcceptorService<T>;
|
||||||
@ -61,8 +60,7 @@ pub struct NativeTlsAcceptorService<T> {
|
|||||||
conns: Counter,
|
conns: Counter,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: AsyncRead + AsyncWrite> Service for NativeTlsAcceptorService<T> {
|
impl<T: AsyncRead + AsyncWrite> Service<T> for NativeTlsAcceptorService<T> {
|
||||||
type Request = T;
|
|
||||||
type Response = TlsStream<T>;
|
type Response = TlsStream<T>;
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
type Future = Accept<T>;
|
type Future = Accept<T>;
|
||||||
|
@ -36,8 +36,7 @@ impl<T: AsyncRead + AsyncWrite> Clone for OpensslAcceptor<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: AsyncRead + AsyncWrite> NewService for OpensslAcceptor<T> {
|
impl<T: AsyncRead + AsyncWrite> NewService<T> for OpensslAcceptor<T> {
|
||||||
type Request = T;
|
|
||||||
type Response = SslStream<T>;
|
type Response = SslStream<T>;
|
||||||
type Error = HandshakeError<T>;
|
type Error = HandshakeError<T>;
|
||||||
type Service = OpensslAcceptorService<T>;
|
type Service = OpensslAcceptorService<T>;
|
||||||
@ -61,8 +60,7 @@ pub struct OpensslAcceptorService<T> {
|
|||||||
conns: Counter,
|
conns: Counter,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: AsyncRead + AsyncWrite> Service for OpensslAcceptorService<T> {
|
impl<T: AsyncRead + AsyncWrite> Service<T> for OpensslAcceptorService<T> {
|
||||||
type Request = T;
|
|
||||||
type Response = SslStream<T>;
|
type Response = SslStream<T>;
|
||||||
type Error = HandshakeError<T>;
|
type Error = HandshakeError<T>;
|
||||||
type Future = OpensslAcceptorServiceFut<T>;
|
type Future = OpensslAcceptorServiceFut<T>;
|
||||||
|
@ -38,8 +38,7 @@ impl<T> Clone for RustlsAcceptor<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: AsyncRead + AsyncWrite> NewService for RustlsAcceptor<T> {
|
impl<T: AsyncRead + AsyncWrite> NewService<T> for RustlsAcceptor<T> {
|
||||||
type Request = T;
|
|
||||||
type Response = TlsStream<T, ServerSession>;
|
type Response = TlsStream<T, ServerSession>;
|
||||||
type Error = io::Error;
|
type Error = io::Error;
|
||||||
type Service = RustlsAcceptorService<T>;
|
type Service = RustlsAcceptorService<T>;
|
||||||
@ -63,8 +62,7 @@ pub struct RustlsAcceptorService<T> {
|
|||||||
conns: Counter,
|
conns: Counter,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: AsyncRead + AsyncWrite> Service for RustlsAcceptorService<T> {
|
impl<T: AsyncRead + AsyncWrite> Service<T> for RustlsAcceptorService<T> {
|
||||||
type Request = T;
|
|
||||||
type Response = TlsStream<T, ServerSession>;
|
type Response = TlsStream<T, ServerSession>;
|
||||||
type Error = io::Error;
|
type Error = io::Error;
|
||||||
type Future = RustlsAcceptorServiceFut<T>;
|
type Future = RustlsAcceptorServiceFut<T>;
|
||||||
|
Loading…
Reference in New Issue
Block a user