Skip to main content

hyperlane_plugin_rewrite/
lib.rs

1//! hyperlane-plugin-rewrite
2//!
3//! High-performance HTTP URL rewrite and redirect plugin for Hyperlane with
4//! canonical host/HTTPS enforcement (`X-Forwarded-Proto` aware), trailing-slash
5//! and duplicate-slash normalization, `O(1)` `XxHash3_64` exact tables, prefix
6//! strip/rewrite rules, and precompiled regex rules.
7
8mod r#const;
9mod r#enum;
10mod r#fn;
11mod r#impl;
12mod r#static;
13mod r#struct;
14
15#[cfg(test)]
16#[path = "../tests/mod.rs"]
17mod tests;
18
19pub use {r#const::*, r#enum::*, r#struct::*};
20
21pub(crate) use {r#fn::*, r#static::*};
22
23use std::{
24    borrow::Cow,
25    cmp::Reverse,
26    collections::VecDeque,
27    error,
28    fmt::{self, Display, Formatter},
29    sync::OnceLock,
30};
31
32use {
33    hyperlane::{
34        Context, FORWARDED, HOST, HashMapXxHash3_64, HttpStatus, LOCATION, RequestHeaders,
35        RequestQuerys, Response, ResponseData, ResponseError, ServerHook, Status, Stream,
36        X_FORWARDED_PROTO, hash_map_xx_hash3_64,
37    },
38    lombok_macros::*,
39    regex::{Error, Regex},
40};