Skip to main content

apply_request_limits

Function apply_request_limits 

Source
pub fn apply_request_limits(router: Router, limits: Limits) -> Router
Expand description

Set whichever of the v1 and v1alpha reflection routes are registered on router to limits, replacing the service-wide limits for them (whether looser or tighter).

install already applies request_limits. Call this yourself, usually with request_limits, after registering a ReflectionService through the generated ServerReflectionExt::register or Router::add_service, since those generic registration paths cannot; or call it after either path with your own Limits to tune the reflection routes specifically. The later call wins.

ยงPanics

Panics if neither reflection route is registered on router.