Skip to main content

hyperlane_plugin_negotiate/
lib.rs

1//! hyperlane-plugin-negotiate
2//!
3//! Response negotiation for the Hyperlane framework: a middleware that answers
4//! with the content coding the client accepts, and a middleware that answers a
5//! conditional request with 304 Not Modified while a validator still matches.
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#struct::*;
18
19pub(crate) use {r#const::*, r#fn::*, r#static::*};
20
21#[cfg(target_arch = "aarch64")]
22#[cfg(target_feature = "neon")]
23#[cfg(target_endian = "little")]
24use std::arch::aarch64::{
25    uint32x2_t, uint32x4_t, uint64x2_t, vaddq_u64, vdup_n_u32, veorq_u64, vextq_u64, vld1q_u8,
26    vld1q_u64, vmlal_u32, vmovn_u64, vmull_u32, vreinterpretq_u32_u64, vreinterpretq_u64_u8,
27    vreinterpretq_u64_u32, vshlq_n_u64, vshrn_n_u64, vshrq_n_u64, vst1q_u64,
28};
29use std::{collections::VecDeque, hash::Hasher, str::from_utf8, sync::OnceLock};
30
31use {
32    http_compress::{Compress, XxHash3_64},
33    hyperlane::{
34        ACCEPT_ENCODING, CACHE_CONTROL, COMMA, CONTENT_ENCODING, CONTENT_TYPE, Context, ETAG,
35        HttpStatus, IF_NONE_MATCH, Method, Request, RequestHeaders, Response, ResponseHeaders,
36        ServerHook, Status, Stream, TEXT_EVENT_STREAM, VARY, VARY_ACCEPT_ENCODING,
37    },
38};