Skip to main content

hyperlane_plugin_timeout/
lib.rs

1//! hyperlane-plugin-timeout
2//!
3//! Global and per-prefix request deadline budgets for Hyperlane with
4//! `X-Request-Timeout` header clamping, [`RequestDeadline`] context propagation,
5//! [`timeout_future`] async helper, and automatic `504 Gateway Timeout` replies.
6
7mod r#const;
8mod r#enum;
9mod r#fn;
10mod r#impl;
11mod r#static;
12mod r#struct;
13
14#[cfg(test)]
15#[path = "../tests/mod.rs"]
16mod tests;
17
18pub use {r#const::*, r#enum::*, r#fn::*, r#struct::*};
19
20pub(crate) use r#static::*;
21
22use std::{
23    cmp::Reverse,
24    error::Error,
25    fmt::{self, Display, Formatter},
26    future::Future,
27    str::from_utf8,
28    sync::OnceLock,
29    time::{Duration, Instant},
30};
31
32use {
33    hyperlane::{
34        CONTENT_TYPE, Context, HttpStatus, Request, Response, ServerHook, Status, Stream,
35        tokio::time::timeout,
36    },
37    lombok_macros::*,
38};