From caaace82e3efe936fe88e34f962e68c8c1f1b40f Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 9 Mar 2018 13:03:15 -0800 Subject: [PATCH] export symbols --- src/client/connector.rs | 2 +- src/ws/frame.rs | 8 ++++---- src/ws/mod.rs | 6 +++--- src/ws/proto.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/client/connector.rs b/src/client/connector.rs index f5ac70aee..6d649fa6b 100644 --- a/src/client/connector.rs +++ b/src/client/connector.rs @@ -77,7 +77,7 @@ pub enum ClientConnectorError { #[fail(display = "{}", _0)] Connector(#[cause] ConnectorError), - /// Connecting took too long + /// Connection took too long #[fail(display = "Timeout out while establishing connection")] Timeout, diff --git a/src/ws/frame.rs b/src/ws/frame.rs index 6075d9041..030ae17af 100644 --- a/src/ws/frame.rs +++ b/src/ws/frame.rs @@ -15,7 +15,7 @@ use ws::mask::apply_mask; /// A struct representing a `WebSocket` frame. #[derive(Debug)] -pub(crate) struct Frame { +pub struct Frame { finished: bool, opcode: OpCode, payload: Binary, @@ -203,15 +203,15 @@ impl Frame { // try to parse ws frame md from one chunk let result = match pl.get_chunk()? { Async::NotReady => return Ok(Async::NotReady), - Async::Ready(Some(chunk)) => Frame::read_chunk_md(chunk, server, max_size)?, Async::Ready(None) => return Ok(Async::Ready(None)), + Async::Ready(Some(chunk)) => Frame::read_chunk_md(chunk, server, max_size)?, }; let (idx, finished, opcode, length, mask) = match result { // we may need to join several chunks Async::NotReady => match Frame::read_copy_md(pl, server, max_size)? { - Async::NotReady => return Ok(Async::NotReady), Async::Ready(Some(item)) => item, + Async::NotReady => return Ok(Async::NotReady), Async::Ready(None) => return Ok(Async::Ready(None)), }, Async::Ready(item) => item, @@ -226,7 +226,7 @@ impl Frame { // remove prefix pl.drop_payload(idx); - // get body + // no need for body if length == 0 { return Ok(Async::Ready(Some(Frame { finished, opcode, payload: Binary::from("") }))); diff --git a/src/ws/mod.rs b/src/ws/mod.rs index 6e540527a..12fb4d709 100644 --- a/src/ws/mod.rs +++ b/src/ws/mod.rs @@ -63,8 +63,8 @@ mod context; mod mask; mod client; -use self::frame::Frame; -use self::proto::{hash_key, OpCode}; +pub use self::frame::Frame; +pub use self::proto::OpCode; pub use self::proto::CloseCode; pub use self::context::WebsocketContext; pub use self::client::{Client, ClientError, @@ -248,7 +248,7 @@ pub fn handshake(req: &HttpRequest) -> Result