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