Expand description
Caller-controlled Axum admission middleware for Runlimit.
RateLimitLayer evaluates one runlimit_core::Check before calling the
wrapped service. Applications supply both trust-sensitive operations:
- a synchronous
ExtractSubjectKeyimplementation that derives an opaquerunlimit_core::SubjectKeyfrom the request; and - a rejection mapper that converts extraction failures, enforced decisions,
and backend failures into an Axum
Response.
This crate never interprets forwarding headers, connection metadata, or
application identities. It also does not select response status codes,
bodies, or headers. A shadow denial permits the request and is available to
downstream code as a runlimit_core::Decision request extension, just
like an allowed decision.
Structs§
- Rate
Limit Layer - A Tower layer that performs one Runlimit admission check per request.
- Rate
Limit Service - The service produced by
RateLimitLayer. - Response
Future - The boxed, sendable response future returned by
RateLimitService.
Enums§
- Rate
Limit Rejection - A rate-limit rejection handed to the application-owned response mapper.
- Rejection
Kind - The non-sensitive category of a
RateLimitRejection.
Traits§
- Extract
Subject Key - A synchronous, application-owned request-to-subject-key boundary.