Reexport useful components

Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
This commit is contained in:
Alexey Galakhov 2017-03-17 15:56:46 +01:00
parent d07f8067ff
commit ac580a666b
4 changed files with 13 additions and 9 deletions

View File

@ -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";

View File

@ -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<Stream, Role>(err: HandshakeError<Stream, Role>) -> Error {
match err {

View File

@ -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();

View File

@ -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;