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;
14mod r#type;
15
16#[cfg(test)]
17#[path = "../tests/mod.rs"]
18mod tests;
19
20pub use {r#const::*, r#enum::*, r#struct::*};
21
22pub(crate) use {r#fn::*, r#static::*, r#type::*};
23
24use std::{
25    borrow::Cow,
26    cmp::Reverse,
27    collections::{HashMap, VecDeque},
28    error,
29    fmt::{self, Display, Formatter},
30    hash::{BuildHasherDefault, Hasher},
31    mem,
32    sync::{Arc, OnceLock},
33};
34
35use {
36    hyperlane::{
37        Context, FORWARDED, HOST, HttpStatus, LOCATION, OK, RequestHeaders, RequestQuerys,
38        Response, ResponseError, ServerHook, Status, Stream, X_FORWARDED_PROTO,
39    },
40    lombok_macros::*,
41    regex::{Error, NoExpand, Regex, RegexSet},
42};