pub fn build_rest_ops_filter(
routes: &'static [RouteTransportDescriptor],
) -> impl Fn(&Request<Body>) + Send + SyncExpand description
Build a rate-limit filter function for REST schemas.
Returns a function that:
- Reads the matched route pattern via
MatchedPath(populated by axum under bothRouter::layerandRouter::route_layer— see module docs). - Looks up the route (matched pattern + HTTP method) in the provided descriptors.
- Returns
false(exempt) ifrate_limited_by_defaultis false. - Returns
true(apply rate limit) if the route participates, or if lookup fails for any reason.
Fails closed: if MatchedPath is absent (the request matched no
route — a 404) or the route isn’t found in routes (a schema/router
mismatch), the request is rate-limited. This prevents accidental
exemptions from missing data or misconfiguration.