Skip to main content

hyperlane_plugin_cache/
lib.rs

1//! hyperlane-plugin-cache
2//!
3//! 64-way sharded bounded cache and HTTP response caching plugin for Hyperlane
4//! with TTL/byte-budget eviction, single-flight stampede coalescing, pluggable
5//! [`CacheStore`] traits, and RFC `Cache-Control`/`Age`/`X-Cache` support.
6
7mod r#const;
8mod r#fn;
9mod r#impl;
10mod r#static;
11mod r#struct;
12mod r#trait;
13mod r#type;
14
15#[cfg(test)]
16#[path = "../tests/mod.rs"]
17mod tests;
18
19pub use {r#const::*, r#struct::*, r#trait::*, r#type::*};
20
21pub(crate) use {r#fn::*, r#static::*};
22
23use std::{
24    array::from_fn,
25    borrow::Cow,
26    collections::VecDeque,
27    future::Future,
28    pin::Pin,
29    str::from_utf8,
30    sync::{
31        Arc, Mutex, OnceLock, RwLock, RwLockReadGuard, RwLockWriteGuard,
32        atomic::{AtomicU64, AtomicUsize, Ordering},
33    },
34    time::{Duration, SystemTime, UNIX_EPOCH},
35};
36
37use {
38    hyperlane::{
39        AGE, AUTHORIZATION, CACHE_CONTROL, CONTENT_ENCODING, COOKIE, Context, HashMapXxHash3_64,
40        HttpStatus, Request, RequestQuerys, Response, ResponseError, ServerHook, Status, Stream,
41        TRANSFER_ENCODING, VARY, hash_map_xx_hash3_64,
42        tokio::sync::{Notify, futures::Notified},
43    },
44    lombok_macros::*,
45};