channel_server/response/
mod.rs

1use bytes::Bytes;
2
3use crate::{Response, StatusCode, IntoResponse};
4
5impl IntoResponse for Response {
6    fn into_response(self) -> Response {
7        self
8    }
9}
10
11impl IntoResponse for String {
12    fn into_response(self) -> Response {
13        Response::new().status(StatusCode::ok()).body(self.into())
14    }
15}
16
17impl IntoResponse for &'static str {
18    fn into_response(self) -> Response {
19        Response::new().status(StatusCode::ok()).body(self.into())
20    }
21}
22
23impl IntoResponse for &'static [u8] {
24    fn into_response(self) -> Response {
25        Response::new().status(StatusCode::ok()).body(self.into())
26    }
27}
28
29impl IntoResponse for Bytes {
30    fn into_response(self) -> Response {
31        Response::new().status(StatusCode::ok()).body(self)
32    }
33}
34
35impl IntoResponse for Vec<u8> {
36    fn into_response(self) -> Response {
37        Response::new().status(StatusCode::ok()).body(self.into())
38    }
39}
40
41impl IntoResponse for () {
42    fn into_response(self) -> Response {
43        Response::new().status(StatusCode::ok())
44    }
45}