hyperlane-plugin-idempotency 23.2.0

A production HTTP Idempotency-Key middleware plugin for the Hyperlane framework featuring XxHash3_64 request fingerprinting (422 mismatch), 64-way sharded bounded InMemoryIdempotencyStore + async IdempotencyStore trait, InFlight concurrent duplicate guard (409 Conflict), and zero-copy cached response replay with Idempotent-Replayed headers.
Documentation
//! hyperlane-plugin-idempotency
//!
//! Production HTTP `Idempotency-Key` middleware for Hyperlane mutation methods
//! with `XxHash3_64` `(method, path, body)` fingerprinting, 64-way sharded
//! bounded memory storage, pluggable async [`IdempotencyStore`], `InFlight`
//! concurrent duplicate protection, and zero-copy cached response replay.

mod r#const;
mod r#enum;
mod r#fn;
mod r#impl;
mod r#static;
mod r#struct;
mod r#trait;
mod r#type;

#[cfg(test)]
#[path = "../tests/mod.rs"]
mod tests;

pub use {r#const::*, r#enum::*, r#fn::*, r#struct::*, r#trait::*, r#type::*};

pub(crate) use r#static::*;

use std::{
    array::from_fn,
    collections::VecDeque,
    future::{Future, ready},
    mem::take,
    pin::Pin,
    str::from_utf8,
    sync::{
        Arc, OnceLock, RwLock, RwLockWriteGuard,
        atomic::{AtomicBool, AtomicUsize, Ordering},
    },
    time::{Duration, SystemTime, UNIX_EPOCH},
};

use {
    hyperlane::{
        CONNECT, CONNECTION, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TYPE, Context, DELETE, GET,
        HEAD, HashMapXxHash3_64, HttpStatus, Method, OPTIONS, PATCH, POST, PUT, RETRY_AFTER,
        Request, RequestHeaders, Response, ResponseError, ServerHook, Status, Stream,
        TEXT_EVENT_STREAM, TRACE, TRANSFER_ENCODING, hash_map_xx_hash3_64,
    },
    lombok_macros::*,
};