Skip to main content

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    cmp::Ordering,
30    collections::{HashMap, HashSet},
31    future::Future,
32    hash::{Hash, Hasher},
33    io::{self, Write, stderr, stdout},
34    net::SocketAddr,
35    pin::Pin,
36    sync::{Arc, OnceLock},
37};
38
39use {
40    inventory::collect,
41    lombok_macros::*,
42    regex::Regex,
43    serde::{Deserialize, Serialize},
44    tokio::{
45        net::{TcpListener, TcpStream},
46        spawn,
47        sync::watch::{Receiver, Sender, channel},
48        task::{JoinError, JoinHandle},
49    },
50};