MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / not_found

Function not_found

examples/actix_example/api/src/lib.rs:155–165  ·  view source on GitHub ↗
(data: web::Data<AppState>, request: HttpRequest)

Source from the content-addressed store, hash-verified

153}
154
155async fn not_found(data: web::Data<AppState>, request: HttpRequest) -> Result<HttpResponse, Error> {
156 let mut ctx = tera::Context::new();
157 ctx.insert("uri", request.uri().path());
158
159 let template = &data.templates;
160 let body = template
161 .render("error/404.html.tera", &ctx)
162 .map_err(|_| error::ErrorInternalServerError("Template error"))?;
163
164 Ok(HttpResponse::Ok().content_type("text/html").body(body))
165}
166
167#[actix_web::main]
168async fn start() -> std::io::Result<()> {

Callers

nothing calls this directly

Calls 2

newFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected