websocket_codec/
lib.rs

1#![warn(missing_docs)]
2#![warn(rust_2018_idioms)]
3#![cfg_attr(feature = "nightly", feature(test))]
4
5//! A Tokio codec implementation of the WebSocket protocol.
6//!
7//! This crate does not do any I/O directly. For a full WebSocket client, see the [websocket-lite](https://docs.rs/websocket-lite) crate.
8
9#[cfg(test)]
10#[macro_use]
11extern crate quickcheck_macros;
12
13#[cfg(all(feature = "nightly", test))]
14extern crate test;
15
16mod frame;
17mod mask;
18mod message;
19mod opcode;
20mod upgrade;
21
22pub mod protocol;
23
24pub use crate::message::{Message, MessageCodec};
25pub use crate::opcode::Opcode;
26pub use crate::upgrade::{ClientRequest, UpgradeCodec};
27
28use std::error;
29use std::result;
30
31/// Represents errors that can be exposed by this crate.
32pub type Error = Box<dyn error::Error + Send + Sync + 'static>;
33
34/// Represents results returned by the non-async functions in this crate.
35pub type Result<T> = result::Result<T, Error>;