rtv/
lib.rs

1
2//! # Rtv
3//!
4//! Rtv is a simple, minimal dependency HTTP client that runs ontop of [`mio`](https://docs.rs/mio/0.8.8/mio).
5//!
6//! This library allows you to `asyncronously` send requests using `async` or [`mio`](https://docs.rs/mio/0.8.8/mio) directly.
7//! Using `mio` is verbose but allows for a much more light weight architecture and fine grained control because *you* do the event
8//! handling.
9//!
10//! I think that using tokio is overkill for most applications. It takes ages to build and requires 100+ dependencies
11//! just to get a simple http client up and running.
12//!
13//! Depending on how what you need you can choose between:
14//! - A [`Client`], which gives you full controll and is used with a [`mio::Poll`](https://docs.rs/mio/latest/mio/struct.Poll.html).
15//! - A [`SimpleClient`], which enables you to use the `async` ecosystem, still in a lightweight way.
16//!
17//! ### Supported features:
18//! - Plain HTTP requests
19//! - Secure HTTPS requests
20//! - Chunked transfer encoding
21//! - Nonblocking DNS lookup & HTTP requests
22//! - Timeouts
23//! - Lightweight, runtime independent `async` reqests
24//! 
25//! ### Currently **not** implemented:
26//! - Connection keep alive
27//! - Compression (gzip etc.)
28//! - Different text encodings
29//! - Url percent encoding
30//! - Automatic redirects
31//! - Maybe more...
32//!
33//! The crate currently uses google's dns server (8.8.8.8) for dns lookups.
34//!
35//! # Features
36//!
37//! The `tls` default-feature enables the use of HTTPS using rustls.
38//! The `async` default-feature enables the `SimpleClient` functionality.
39//!
40
41mod util;
42mod dns;
43pub mod http;
44pub mod client;
45#[cfg(test)]
46mod test;
47
48pub use {
49    http::*,
50    client::*
51};
52
53#[cfg(all(unix, feature = "async"))]
54pub mod simple;
55
56#[cfg(all(unix, feature = "async"))]
57pub use simple::*;