From 02684b4946c0dda51b03fc20adc63190c19d8ebe Mon Sep 17 00:00:00 2001 From: Danny Browning Date: Thu, 12 Sep 2019 12:58:42 -0600 Subject: [PATCH] Try removing unpin --- src/client.rs | 4 ++-- src/handshake/client.rs | 4 ++-- src/handshake/mod.rs | 2 +- src/handshake/server.rs | 4 ++-- src/server.rs | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/client.rs b/src/client.rs index f5f34b4..cea3086 100644 --- a/src/client.rs +++ b/src/client.rs @@ -179,7 +179,7 @@ pub fn client_with_config<'t, Stream, Req>( config: Option, ) -> StdResult<(WebSocket, Response), HandshakeError>> where - Stream: Read + Write + Unpin, + Stream: Read + Write, Req: Into>, { ClientHandshake::start(stream, request.into(), config).handshake() @@ -195,7 +195,7 @@ pub fn client<'t, Stream, Req>( stream: Stream, ) -> StdResult<(WebSocket, Response), HandshakeError>> where - Stream: Read + Write + Unpin, + Stream: Read + Write, Req: Into>, { client_with_config(request, stream, None) diff --git a/src/handshake/client.rs b/src/handshake/client.rs index 5491fbf..8203ee5 100644 --- a/src/handshake/client.rs +++ b/src/handshake/client.rs @@ -73,7 +73,7 @@ pub struct ClientHandshake { _marker: PhantomData, } -impl ClientHandshake { +impl ClientHandshake { /// Initiate a client handshake. pub fn start( stream: S, @@ -124,7 +124,7 @@ impl ClientHandshake { } } -impl HandshakeRole for ClientHandshake { +impl HandshakeRole for ClientHandshake { type IncomingData = Response; type InternalStream = S; type FinalResult = (WebSocket, Response); diff --git a/src/handshake/mod.rs b/src/handshake/mod.rs index 90bfd4d..828de65 100644 --- a/src/handshake/mod.rs +++ b/src/handshake/mod.rs @@ -101,7 +101,7 @@ pub trait HandshakeRole { #[doc(hidden)] type IncomingData: TryParse; #[doc(hidden)] - type InternalStream: Read + Write + Unpin; + type InternalStream: Read + Write; #[doc(hidden)] type FinalResult; #[doc(hidden)] diff --git a/src/handshake/server.rs b/src/handshake/server.rs index 696f97e..615a755 100644 --- a/src/handshake/server.rs +++ b/src/handshake/server.rs @@ -153,7 +153,7 @@ pub struct ServerHandshake { _marker: PhantomData, } -impl ServerHandshake { +impl ServerHandshake { /// Start server handshake. `callback` specifies a custom callback which the user can pass to /// the handshake, this callback will be called when the a websocket client connnects to the /// server, you can specify the callback if you want to add additional header to the client @@ -172,7 +172,7 @@ impl ServerHandshake { } } -impl HandshakeRole for ServerHandshake { +impl HandshakeRole for ServerHandshake { type IncomingData = Request; type InternalStream = S; type FinalResult = WebSocket; diff --git a/src/server.rs b/src/server.rs index d4c12fd..725d892 100644 --- a/src/server.rs +++ b/src/server.rs @@ -18,7 +18,7 @@ use std::io::{Read, Write}; /// If you want TLS support, use `native_tls::TlsStream` or `openssl::ssl::SslStream` /// for the stream here. Any `Read + Write` streams are supported, including /// those from `Mio` and others. -pub fn accept_with_config( +pub fn accept_with_config( stream: S, config: Option, ) -> Result, HandshakeError>> { @@ -31,7 +31,7 @@ pub fn accept_with_config( /// If you want TLS support, use `native_tls::TlsStream` or `openssl::ssl::SslStream` /// for the stream here. Any `Read + Write` streams are supported, including /// those from `Mio` and others. -pub fn accept( +pub fn accept( stream: S, ) -> Result, HandshakeError>> { accept_with_config(stream, None) @@ -45,7 +45,7 @@ pub fn accept( /// This function does the same as `accept()` but accepts an extra callback /// for header processing. The callback receives headers of the incoming /// requests and is able to add extra headers to the reply. -pub fn accept_hdr_with_config( +pub fn accept_hdr_with_config( stream: S, callback: C, config: Option, @@ -58,7 +58,7 @@ pub fn accept_hdr_with_config( /// This function does the same as `accept()` but accepts an extra callback /// for header processing. The callback receives headers of the incoming /// requests and is able to add extra headers to the reply. -pub fn accept_hdr( +pub fn accept_hdr( stream: S, callback: C, ) -> Result, HandshakeError>> {