Skip to main content

net_io/
lib.rs

1//! # net_io
2//!
3//! The network IO substrate for the `-net` and `-io` crates: the entrance
4//! and exit every service shares. It owns listeners and sockets (TCP, UDP,
5//! Unix domain sockets, Windows named pipes), the lifecycle of each
6//! connection, the limits and timeouts that keep a peer from pinning the
7//! server, graceful drain, the PROXY protocol for running behind a reverse
8//! proxy, and the seams that TLS and the connection gate plug into.
9//!
10//! It is protocol-free. It moves bytes and knows who is on the other end of
11//! a connection; it does not know whether those bytes are HTTP, a database
12//! wire protocol, or Raft messages. Protocol engines such as `http-net` and
13//! `ws-net` sit on top of it.
14//!
15//! ## Status
16//!
17//! Design lock (`0.2.0`). No functional code yet. The public API is locked in
18//! `docs/API.md`, the design and its decisions in `dev/PLAN.md`, and the
19//! milestone schedule in `dev/ROADMAP.md` (all in the
20//! [repository](https://github.com/jamesgober/net-io)). `0.3.0` brings TCP
21//! with the blocking driver.
22
23#![doc(html_root_url = "https://docs.rs/net-io")]
24#![cfg_attr(docsrs, feature(doc_cfg))]
25#![forbid(unsafe_code)]
26#![deny(missing_docs)]
27
28/// Crate version string, populated by Cargo at build time.
29pub const VERSION: &str = env!("CARGO_PKG_VERSION");
30
31#[cfg(test)]
32mod tests {
33    use super::VERSION;
34
35    #[test]
36    fn version_matches_manifest() {
37        assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
38        assert_eq!(VERSION.split('.').count(), 3, "expected MAJOR.MINOR.PATCH");
39    }
40}