#![deny(missing_docs)]
#![deny(warnings)]
#![cfg_attr(feature = "nightly", feature(slice_align_to))]
#![cfg_attr(feature = "nightly", feature(test))]
#![cfg_attr(feature = "cargo-clippy", feature(tool_lints))]
extern crate base64;
extern crate byteorder;
extern crate bytes;
extern crate futures;
extern crate httparse;
extern crate rand;
extern crate sha1;
extern crate take_mut;
extern crate tokio_codec;
extern crate tokio_io;
extern crate tokio_tcp;
extern crate url;
#[cfg(test)]
#[macro_use]
extern crate quickcheck;
#[cfg(all(feature = "nightly", test))]
extern crate test;
#[cfg(feature = "ssl-native-tls")]
extern crate native_tls;
#[cfg(feature = "ssl-native-tls")]
extern crate tokio_tls;
#[cfg(feature = "ssl-openssl")]
extern crate openssl;
#[cfg(feature = "ssl-openssl")]
extern crate tokio_openssl;
mod client;
mod frame;
mod mask;
mod message;
mod opcode;
mod ssl;
mod sync;
mod upgrade;
pub use client::ClientBuilder;
pub use message::{Message, MessageCodec};
pub use opcode::Opcode;
use std::error;
use std::io::{Read, Write};
use std::result;
use tokio_codec::Framed;
use tokio_io::{AsyncRead, AsyncWrite};
pub type Error = Box<error::Error + 'static>;
pub type Result<T> = result::Result<T, Error>;
pub trait AsyncNetworkStream: AsyncRead + AsyncWrite {}
impl<S> AsyncNetworkStream for S
where
S: AsyncRead + AsyncWrite,
{
}
pub trait NetworkStream: Read + Write {}
impl<S> NetworkStream for S
where
S: Read + Write,
{
}
pub type AsyncClient<S> = Framed<S, MessageCodec>;
pub type Client<S> = sync::Framed<S, MessageCodec>;