From ac580a666bad1f4b20d2cef8fa32d760e0e6099c Mon Sep 17 00:00:00 2001 From: Alexey Galakhov Date: Fri, 17 Mar 2017 15:56:46 +0100 Subject: [PATCH] Reexport useful components Signed-off-by: Alexey Galakhov --- examples/autobahn-client.rs | 3 +-- examples/autobahn-server.rs | 4 +--- examples/client.rs | 3 +-- src/lib.rs | 12 ++++++++++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/autobahn-client.rs b/examples/autobahn-client.rs index 75c15e8..6b72b60 100644 --- a/examples/autobahn-client.rs +++ b/examples/autobahn-client.rs @@ -5,8 +5,7 @@ extern crate url; use url::Url; -use tungstenite::client::connect; -use tungstenite::error::{Error, Result}; +use tungstenite::{connect, Error, Result}; const AGENT: &'static str = "Tungstenite"; diff --git a/examples/autobahn-server.rs b/examples/autobahn-server.rs index 4ff44bd..d0bcbcc 100644 --- a/examples/autobahn-server.rs +++ b/examples/autobahn-server.rs @@ -5,9 +5,7 @@ extern crate tungstenite; use std::net::{TcpListener, TcpStream}; use std::thread::spawn; -use tungstenite::server::accept; -use tungstenite::handshake::HandshakeError; -use tungstenite::error::{Error, Result}; +use tungstenite::{accept, HandshakeError, Error, Result}; fn must_not_block(err: HandshakeError) -> Error { match err { diff --git a/examples/client.rs b/examples/client.rs index 22ae38c..d8a176f 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -3,8 +3,7 @@ extern crate url; extern crate env_logger; use url::Url; -use tungstenite::protocol::Message; -use tungstenite::client::connect; +use tungstenite::{Message, connect}; fn main() { env_logger::init().unwrap(); diff --git a/src/lib.rs b/src/lib.rs index 3413dc2..60584af 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,7 +24,15 @@ pub mod protocol; pub mod client; pub mod server; pub mod handshake; +pub mod stream; +pub mod util; mod input_buffer; -mod stream; -mod util; + +pub use client::{connect, client}; +pub use server::accept; +pub use error::{Error, Result}; +pub use protocol::{WebSocket, Message}; +pub use handshake::HandshakeError; +pub use handshake::client::ClientHandshake; +pub use handshake::server::ServerHandshake;