Skip to main content

dynamic_mock_fallback

Function dynamic_mock_fallback 

Source
pub async fn dynamic_mock_fallback(
    __arg0: State<ManagementState>,
    req: Request<Body>,
) -> Response
Expand description

Axum fallback handler for the main router: tries to serve a dynamic mock, or returns 404. Only invoked when nothing else in the router matched.

Wire via .fallback_service(axum::routing::any(dynamic_mock_fallback).with_state(state)) so the handler’s own State<ManagementState> extractor is satisfied without forcing the parent router to adopt ManagementState as its state.