hyperlane/
lib.rs

1//! hyperlane
2//!
3//! A lightweight, high-performance, and cross-platform
4//! Rust HTTP server library built on Tokio. It simplifies
5//! modern web service development by providing built-in
6//! support for middleware, WebSocket, Server-Sent Events (SSE),
7//! and raw TCP communication. With a unified and ergonomic API
8//! across Windows, Linux, and MacOS, it enables developers to
9//! build robust, scalable, and event-driven network
10//! applications with minimal overhead and maximum flexibility.
11
12mod attribute;
13mod config;
14mod context;
15mod error;
16mod hook;
17mod panic;
18mod route;
19mod server;
20
21pub use {attribute::*, config::*, context::*, error::*, hook::*, panic::*, route::*, server::*};
22
23pub use {http_type::*, inventory};
24
25#[cfg(test)]
26use std::time::{Duration, Instant};
27use std::{
28    any::Any,
29    borrow::Borrow,
30    cmp::Ordering,
31    collections::{HashMap, HashSet},
32    future::Future,
33    hash::{Hash, Hasher},
34    io::{self, Write, stderr, stdout},
35    net::SocketAddr,
36    pin::Pin,
37    sync::Arc,
38};
39
40use {
41    inventory::collect,
42    lombok_macros::*,
43    regex::Regex,
44    serde::{Deserialize, Serialize, de::DeserializeOwned},
45    tokio::{
46        net::{TcpListener, TcpStream},
47        spawn,
48        sync::{
49            RwLockReadGuard, RwLockWriteGuard,
50            watch::{Receiver, Sender, channel},
51        },
52        task::{JoinError, JoinHandle},
53    },
54};