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 lifetime;
18mod panic;
19mod route;
20mod server;
21
22pub use {
23    attribute::*, config::*, context::*, error::*, hook::*, lifetime::*, panic::*, route::*,
24    server::*,
25};
26
27pub use {http_type::*, inventory};
28
29#[cfg(test)]
30use std::time::{Duration, Instant};
31use std::{
32    any::Any,
33    cmp::Ordering,
34    collections::{HashMap, HashSet},
35    future::Future,
36    hash::{Hash, Hasher},
37    io::{self, Write, stderr, stdout},
38    pin::Pin,
39    sync::{Arc, OnceLock},
40};
41
42#[cfg(test)]
43use tokio::time::sleep;
44use {
45    inventory::collect,
46    lombok_macros::*,
47    regex::Regex,
48    serde::{Deserialize, Serialize},
49    tokio::{
50        net::{TcpListener, TcpStream},
51        spawn,
52        sync::watch::{Receiver, Sender, channel},
53        task::{JoinError, JoinHandle},
54    },
55};