Skip to main content

hyperlane_plugin_idempotency/
lib.rs

1//! hyperlane-plugin-idempotency
2//!
3//! Production HTTP `Idempotency-Key` middleware for Hyperlane mutation methods
4//! with `XxHash3_64` `(method, path, body)` fingerprinting, 64-way sharded
5//! bounded memory storage, pluggable async [`IdempotencyStore`], `InFlight`
6//! concurrent duplicate protection, and zero-copy cached response replay.
7
8mod r#const;
9mod r#enum;
10mod r#fn;
11mod r#impl;
12mod r#static;
13mod r#struct;
14mod r#trait;
15mod r#type;
16
17#[cfg(test)]
18#[path = "../tests/mod.rs"]
19mod tests;
20
21pub use {r#const::*, r#enum::*, r#fn::*, r#struct::*, r#trait::*, r#type::*};
22
23pub(crate) use r#static::*;
24
25use std::{
26    array::from_fn,
27    collections::VecDeque,
28    future::Future,
29    hash::Hasher,
30    pin::Pin,
31    sync::{
32        Arc, OnceLock, RwLock, RwLockWriteGuard,
33        atomic::{AtomicBool, AtomicUsize, Ordering},
34    },
35    time::{Duration, SystemTime, UNIX_EPOCH},
36};
37
38use {
39    hyperlane::{
40        CONTENT_TYPE, Context, HashMapXxHash3_64, HttpStatus, Method, RETRY_AFTER, RequestHeaders,
41        Response, ResponseData, ResponseError, ServerHook, Status, Stream, XxHash3_64,
42        hash_map_xx_hash3_64,
43    },
44    lombok_macros::*,
45};