pub mod any;
pub mod cache_control;
pub mod catch_panic;
pub mod compression;
pub mod cors;
pub mod default;
pub mod etag;
pub mod request_id;
pub mod sensitive_headers;
pub mod size_limit;
pub mod timeout;
pub mod tracing;
use crate::app::context::AppContext;
use crate::error::RoadsterResult;
use axum::Router;
use axum_core::extract::FromRef;
#[cfg_attr(test, mockall::automock)]
pub trait Middleware<S>: Send
where
S: Clone + Send + Sync + 'static,
AppContext: FromRef<S>,
{
fn name(&self) -> String;
fn enabled(&self, state: &S) -> bool;
fn priority(&self, state: &S) -> i32;
fn install(&self, router: Router, state: &S) -> RoadsterResult<Router>;
}