Module v2

Module v2 

Source
Expand description

§Middleware V2

New middleware system with handle(request, next) pattern for Laravel-style simplicity. This is the new middleware API that will replace the current one.

Modules§

composition
Middleware composition utilities
factories
Middleware factories for common patterns
introspection
Middleware introspection and debugging utilities

Structs§

BodyLimitMiddleware
Body size limit middleware
ComposedMiddleware
A composed middleware that executes two middleware in sequence
ConditionalMiddleware
Conditional middleware wrapper that can skip execution based on path patterns and HTTP methods
CorsMiddleware
CORS middleware
LoggingMiddleware
Example logging middleware using the new pattern
MiddlewarePipelineV2
Middleware pipeline for the new system
Next
Next represents the rest of the middleware chain
ProfilerMiddleware
Middleware profiler that logs timing for each middleware in the pipeline
RateLimitMiddleware
Rate limiting middleware
SimpleAuthMiddleware
Example auth middleware using the new pattern
TimeoutMiddleware
Timeout middleware

Traits§

Middleware
New middleware trait with Laravel-style handle(request, next) pattern Uses boxed futures to be dyn-compatible

Type Aliases§

NextFuture
Type alias for boxed future in Next