utp/lib.rs
1//! Implementation of the [Micro Transport Protocol][spec].
2//!
3//! This library provides both a socket interface (`UtpSocket`) and a stream
4//! interface (`UtpStream`).
5//! I recommend that you use `UtpStream`, as it implements the `Read` and
6//! `Write` traits we all know (and love) from `std::io`, which makes it
7//! generally easier to work with than `UtpSocket`.
8//!
9//! [spec]: http://www.bittorrent.org/beps/bep_0029.html
10//!
11//! # Installation
12//!
13//! Ensure your `Cargo.toml` contains:
14//!
15//! ```toml
16//! [dependencies]
17//! utp = "*"
18//! ```
19#![deny(missing_docs)]
20// Optional features
21#![cfg_attr(feature = "clippy", feature(plugin))]
22#![cfg_attr(feature = "clippy", plugin(clippy))]
23#![cfg_attr(feature = "nightly", feature(test))]
24#![cfg_attr(
25 feature = "clippy",
26 allow(
27 len_without_is_empty,
28 doc_markdown,
29 needless_return,
30 cast_ptr_alignment,
31 )
32)]
33
34#[macro_use]
35extern crate log;
36
37// Public API
38pub use socket::BufferedUtpStream;
39pub use socket::UtpSocketRef as UtpSocket;
40pub use socket::UtpStream;
41pub use socket::UtpStreamDriver;
42
43mod bit_iterator;
44mod error;
45mod packet;
46mod socket;
47mod time;
48mod util;