1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-30 16:40:21 +02:00

migrate to new Service<Request> trait

This commit is contained in:
Nikolay Kim
2018-11-29 16:56:15 -10:00
parent c62567f85f
commit 1b1ae01b5a
26 changed files with 595 additions and 605 deletions

View File

@@ -38,8 +38,7 @@ impl<T> Clone for RustlsAcceptor<T> {
}
}
impl<T: AsyncRead + AsyncWrite> NewService for RustlsAcceptor<T> {
type Request = T;
impl<T: AsyncRead + AsyncWrite> NewService<T> for RustlsAcceptor<T> {
type Response = TlsStream<T, ServerSession>;
type Error = io::Error;
type Service = RustlsAcceptorService<T>;
@@ -63,8 +62,7 @@ pub struct RustlsAcceptorService<T> {
conns: Counter,
}
impl<T: AsyncRead + AsyncWrite> Service for RustlsAcceptorService<T> {
type Request = T;
impl<T: AsyncRead + AsyncWrite> Service<T> for RustlsAcceptorService<T> {
type Response = TlsStream<T, ServerSession>;
type Error = io::Error;
type Future = RustlsAcceptorServiceFut<T>;
@@ -77,7 +75,7 @@ impl<T: AsyncRead + AsyncWrite> Service for RustlsAcceptorService<T> {
}
}
fn call(&mut self, req: Self::Request) -> Self::Future {
fn call(&mut self, req: T) -> Self::Future {
RustlsAcceptorServiceFut {
_guard: self.conns.get(),
fut: self.acceptor.accept(req),