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
//! # unit-rs
//!
//! `unit-rs` is a safe wrapper around the C `libunit` library from [Nginx Unit],
//! which allows creating Unit applications in Rust.
//!
//! [Nginx Unit]: https://unit.nginx.org/
//!
//! Currently very few features are supported, but enough are available to
//! inspect all aspects of a request and create a response.
//!
//! ## Example
//!
//! ```no_run
//! use unit_rs::Unit;
//!
//! fn main() {
//! let mut unit = Unit::new();
//!
//! unit.set_request_handler(|req| {
//! let headers = &[("Content-Type", "text/plain")];
//! let body = "Hello world!\n";
//! req.create_response(headers, body)?;
//!
//! Ok(())
//! });
//!
//! unit.run();
//! }
//! ```
pub use ;
pub use ;
pub use UnitRequest;
pub use UnitResponse;
pub use Unit;