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

#[macro_use]
extern crate log;

// Public API
pub use socket::BufferedUtpStream;
pub use socket::UtpSocketRef as UtpSocket;
pub use socket::UtpStream;
pub use socket::UtpStreamDriver;

mod bit_iterator;
mod error;
mod packet;
mod socket;
mod time;
mod util;