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