From a3358230984c3c42093eda7b2b7baea3e01eac53 Mon Sep 17 00:00:00 2001 From: quininer kel Date: Thu, 16 Mar 2017 10:17:30 +0800 Subject: [PATCH] [Fixed] feature tokio-proto --- src/proto.rs | 66 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/proto.rs b/src/proto.rs index c1b60d4..688bb19 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -14,11 +14,11 @@ extern crate tokio_proto; use std::io; use std::sync::Arc; use futures::{ Future, IntoFuture, Poll }; +use tokio_io::{ AsyncRead, AsyncWrite }; use rustls::{ ServerConfig, ClientConfig, ServerSession, ClientSession }; use self::tokio_proto::multiplex; use self::tokio_proto::pipeline; use self::tokio_proto::streaming; -use tokio_core::io::Io; use { TlsStream, ServerConfigExt, ClientConfigExt, AcceptAsync, ConnectAsync }; @@ -52,14 +52,14 @@ impl Server { /// Future returned from `bind_transport` in the `ServerProto` implementation. pub struct ServerPipelineBind where T: pipeline::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { state: PipelineState, } enum PipelineState where T: pipeline::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { First(AcceptAsync, Arc), Next(::Future), @@ -67,7 +67,7 @@ enum PipelineState impl pipeline::ServerProto for Server where T: pipeline::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Request = T::Request; type Response = T::Response; @@ -85,7 +85,7 @@ impl pipeline::ServerProto for Server impl Future for ServerPipelineBind where T: pipeline::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Item = T::Transport; type Error = io::Error; @@ -109,14 +109,14 @@ impl Future for ServerPipelineBind /// Future returned from `bind_transport` in the `ServerProto` implementation. pub struct ServerMultiplexBind where T: multiplex::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { state: MultiplexState, } enum MultiplexState where T: multiplex::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { First(AcceptAsync, Arc), Next(::Future), @@ -124,7 +124,7 @@ enum MultiplexState impl multiplex::ServerProto for Server where T: multiplex::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Request = T::Request; type Response = T::Response; @@ -142,7 +142,7 @@ impl multiplex::ServerProto for Server impl Future for ServerMultiplexBind where T: multiplex::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Item = T::Transport; type Error = io::Error; @@ -166,14 +166,14 @@ impl Future for ServerMultiplexBind /// Future returned from `bind_transport` in the `ServerProto` implementation. pub struct ServerStreamingPipelineBind where T: streaming::pipeline::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { state: StreamingPipelineState, } enum StreamingPipelineState where T: streaming::pipeline::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { First(AcceptAsync, Arc), Next(::Future), @@ -181,7 +181,7 @@ enum StreamingPipelineState impl streaming::pipeline::ServerProto for Server where T: streaming::pipeline::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Request = T::Request; type RequestBody = T::RequestBody; @@ -202,7 +202,7 @@ impl streaming::pipeline::ServerProto for Server impl Future for ServerStreamingPipelineBind where T: streaming::pipeline::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Item = T::Transport; type Error = io::Error; @@ -226,14 +226,14 @@ impl Future for ServerStreamingPipelineBind /// Future returned from `bind_transport` in the `ServerProto` implementation. pub struct ServerStreamingMultiplexBind where T: streaming::multiplex::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { state: StreamingMultiplexState, } enum StreamingMultiplexState where T: streaming::multiplex::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { First(AcceptAsync, Arc), Next(::Future), @@ -241,7 +241,7 @@ enum StreamingMultiplexState impl streaming::multiplex::ServerProto for Server where T: streaming::multiplex::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Request = T::Request; type RequestBody = T::RequestBody; @@ -262,7 +262,7 @@ impl streaming::multiplex::ServerProto for Server impl Future for ServerStreamingMultiplexBind where T: streaming::multiplex::ServerProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Item = T::Transport; type Error = io::Error; @@ -315,14 +315,14 @@ impl Client { /// Future returned from `bind_transport` in the `ClientProto` implementation. pub struct ClientPipelineBind where T: pipeline::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { state: ClientPipelineState, } enum ClientPipelineState where T: pipeline::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { First(ConnectAsync, Arc), Next(::Future), @@ -330,7 +330,7 @@ enum ClientPipelineState impl pipeline::ClientProto for Client where T: pipeline::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Request = T::Request; type Response = T::Response; @@ -349,7 +349,7 @@ impl pipeline::ClientProto for Client impl Future for ClientPipelineBind where T: pipeline::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Item = T::Transport; type Error = io::Error; @@ -373,14 +373,14 @@ impl Future for ClientPipelineBind /// Future returned from `bind_transport` in the `ClientProto` implementation. pub struct ClientMultiplexBind where T: multiplex::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { state: ClientMultiplexState, } enum ClientMultiplexState where T: multiplex::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { First(ConnectAsync, Arc), Next(::Future), @@ -388,7 +388,7 @@ enum ClientMultiplexState impl multiplex::ClientProto for Client where T: multiplex::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Request = T::Request; type Response = T::Response; @@ -407,7 +407,7 @@ impl multiplex::ClientProto for Client impl Future for ClientMultiplexBind where T: multiplex::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Item = T::Transport; type Error = io::Error; @@ -431,14 +431,14 @@ impl Future for ClientMultiplexBind /// Future returned from `bind_transport` in the `ClientProto` implementation. pub struct ClientStreamingPipelineBind where T: streaming::pipeline::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { state: ClientStreamingPipelineState, } enum ClientStreamingPipelineState where T: streaming::pipeline::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { First(ConnectAsync, Arc), Next(::Future), @@ -446,7 +446,7 @@ enum ClientStreamingPipelineState impl streaming::pipeline::ClientProto for Client where T: streaming::pipeline::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Request = T::Request; type RequestBody = T::RequestBody; @@ -468,7 +468,7 @@ impl streaming::pipeline::ClientProto for Client impl Future for ClientStreamingPipelineBind where T: streaming::pipeline::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Item = T::Transport; type Error = io::Error; @@ -492,14 +492,14 @@ impl Future for ClientStreamingPipelineBind /// Future returned from `bind_transport` in the `ClientProto` implementation. pub struct ClientStreamingMultiplexBind where T: streaming::multiplex::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { state: ClientStreamingMultiplexState, } enum ClientStreamingMultiplexState where T: streaming::multiplex::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { First(ConnectAsync, Arc), Next(::Future), @@ -507,7 +507,7 @@ enum ClientStreamingMultiplexState impl streaming::multiplex::ClientProto for Client where T: streaming::multiplex::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Request = T::Request; type RequestBody = T::RequestBody; @@ -529,7 +529,7 @@ impl streaming::multiplex::ClientProto for Client impl Future for ClientStreamingMultiplexBind where T: streaming::multiplex::ClientProto>, - I: Io + 'static, + I: AsyncRead + AsyncWrite + 'static, { type Item = T::Transport; type Error = io::Error;