Skip to main content

hyperlane_plugin_compression/
lib.rs

1//! hyperlane-plugin-compression
2//!
3//! Full-duplex opt-in compression middleware for Hyperlane combining bounded
4//! request body decompression (`gzip`, `deflate`, `br`) with automatic
5//! `Accept-Encoding` response negotiation, MIME filtering, and `Vary` merging.
6
7mod r#const;
8mod r#fn;
9mod r#impl;
10mod r#static;
11mod r#struct;
12
13#[cfg(test)]
14#[path = "../tests/mod.rs"]
15mod tests;
16
17pub use {r#const::*, r#struct::*};
18
19pub(crate) use {r#fn::*, r#static::*};
20
21use std::{borrow::Cow, collections::VecDeque, sync::OnceLock};
22
23use {
24    http_compress::Compress,
25    hyperlane::{
26        ACCEPT_ENCODING, CACHE_CONTROL, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TYPE, Context,
27        HttpStatus, Request, Response, ResponseError, ResponseHeaders, ServerHook, Status, Stream,
28        VARY, VARY_ACCEPT_ENCODING,
29    },
30    lombok_macros::*,
31};