pub struct MiddlewareStack {
pub trusted_ranges: Option<TrustedRangesMiddleware>,
pub static_files: Option<StaticFilesMiddleware>,
pub concurrency: Option<ConcurrencyMiddleware>,
pub rate_limit: Option<RateLimitMiddleware>,
pub circuit_breaker: Option<CircuitBreakerMiddleware>,
pub headers: HeadersMiddleware,
pub logging: Option<LoggingMiddleware>,
pub sendfile: Option<SendfileMiddleware>,
pub compression: Option<CompressionMiddleware>,
}Expand description
Middleware stack that composes all middlewares
This struct holds all middleware components and orchestrates their execution in the correct order for both request and response phases.
Fields§
§trusted_ranges: Option<TrustedRangesMiddleware>§static_files: Option<StaticFilesMiddleware>§concurrency: Option<ConcurrencyMiddleware>§rate_limit: Option<RateLimitMiddleware>§circuit_breaker: Option<CircuitBreakerMiddleware>§headers: HeadersMiddleware§logging: Option<LoggingMiddleware>§sendfile: Option<SendfileMiddleware>§compression: Option<CompressionMiddleware>Implementations§
Source§impl MiddlewareStack
impl MiddlewareStack
Sourcepub async fn apply_request_filters(
&self,
session: &mut Session,
ctx: &mut MiddlewareContext,
) -> Result<()>
pub async fn apply_request_filters( &self, session: &mut Session, ctx: &mut MiddlewareContext, ) -> Result<()>
Apply all request filters in order
This is called from ProxyHttp::request_filter() to process the incoming request before it’s sent to the upstream server.
Sourcepub async fn apply_response_filters(
&self,
session: &mut Session,
upstream_response: &mut ResponseHeader,
ctx: &mut MiddlewareContext,
) -> Result<()>
pub async fn apply_response_filters( &self, session: &mut Session, upstream_response: &mut ResponseHeader, ctx: &mut MiddlewareContext, ) -> Result<()>
Apply all response filters in order
This is called from ProxyHttp::response_filter() to process the upstream response before it’s sent to the client.
Auto Trait Implementations§
impl Freeze for MiddlewareStack
impl !RefUnwindSafe for MiddlewareStack
impl Send for MiddlewareStack
impl Sync for MiddlewareStack
impl Unpin for MiddlewareStack
impl !UnwindSafe for MiddlewareStack
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more