tower_embed_core/
response.rs1use crate::Body;
4
5pub fn not_found() -> http::Response<Body> {
7 http::Response::builder()
8 .status(http::StatusCode::NOT_FOUND)
9 .body(Body::empty())
10 .unwrap()
11}
12
13pub fn not_modified() -> http::Response<Body> {
15 http::Response::builder()
16 .status(http::StatusCode::NOT_MODIFIED)
17 .body(Body::empty())
18 .unwrap()
19}
20
21pub fn method_not_allowed() -> http::Response<Body> {
23 http::Response::builder()
24 .header(
25 http::header::ALLOW,
26 http::HeaderValue::from_static("GET, HEAD"),
27 )
28 .status(http::StatusCode::METHOD_NOT_ALLOWED)
29 .body(Body::empty())
30 .unwrap()
31}
32
33pub fn internal_server_error() -> http::Response<Body> {
35 http::Response::builder()
36 .status(http::StatusCode::INTERNAL_SERVER_ERROR)
37 .body(Body::empty())
38 .unwrap()
39}