Skip to main content

render_not_found

Function render_not_found 

Source
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 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.