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 the not-found fallback installed at build Phase 5.6 — which serves both the plain-404 case and, since the slash-redirect probe moved into a layer (gaps4 #50), the no-alternate branch of a slash-redirect app (the layer passes the rendered 404 through untouched when the alternate form doesn’t answer).
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.