pub fn render_not_found(template: Option<&str>, path: &str) -> Response<Body>Expand description
Render the configured 404 template with { path } in scope, or
fall back to the plain-text response when no template is set or
rendering fails.
When template is None and the default pages are enabled, the
framework’s own default_404.html is rendered instead. When
default pages are disabled and no template name is set, returns
plain “Not Found”.
Used by:
crate::slash::slash_redirect_fallbackfor the no-alternate branch.- The standalone not-found fallback installed when only
not_found_templateis set (no slash redirect).
The template gets the request path as path so it can render
The page {{ path }} doesn't exist. without the user wiring
extractors. Other request state isn’t exposed yet — the v1 shape
is intentionally narrow.