https://github.com/http-rs/tide
I'm currently doing something like this.
pub async fn not_found(_ctx: Request<AppState>) -> tide::Result {
let mut buf = Vec::new();
templates::statuscode404(&mut buf)?;
Ok(Response::new(StatusCode::NotFound)
.body(Body::from(buf))
.set_mime(mime::TEXT_HTML_UTF_8))
}
https://github.com/http-rs/tide
I'm currently doing something like this.